Skip to content

snsinahub/sqlcmd

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

sqlcmd

snsinahub/sqlcmd is an action that runs script containing the languages and commands supported by SQL Server SQLCMD.

Supported methods

  • Authentication: windows authentication

Parameters

- uses: snsinahub/[email protected]
  with:   
    
    # Type of command
    # supported values
    # script: pass sql script file to the action
    # example:
    #   sqlcmd_action: "script"
    sqlcmd_action: "script"
    
    # Absolute path to sql file
    # example:
    #   sql_path: 'C:\scripts\run.sql'
    sql_path: 'C:\scripts\run.sql' 
    
    # Name of sql server URL or Machine name
    # example:
    #   server_name: 'C:\project'
    server_name: "sql.snsinahub.com"
    
    # Pass parameters in format of comma separated values
    # IMPORTANT: if you need to put value of each variable inside quotes please follow      #   
    #   sqlcmd_variables: env='dev' account='dev-account'
    #   input_type: inline
    sqlcmd_variables: env='dev' account='dev-account'


    # Pass parameters in format of comma separated values
    # IMPORTANT: if you need to put value of each variable inside quotes USE SINGLE QUOTES ONLY 
    # DOUBLE QUOTES ARE NOT ACCEPTED
    # example:
    #   input_type: inline
    input_type: inline
    
    # Query Timeout
    # example:
    #   query_timeout: 6000
    query_timeout: 6000
    
    # MS SQL Server database name
    # example:
    #   db_name: SSISDB
    db_name: SSISDB

Example

Call Script Without Input

- name: sqlcmd scripts
  uses : snsinahub/[email protected]
  with:
    sqlcmd_action: "script"
    sql_path: 'C:\scripts\run.sql' 
    server_name: "sql.snsinahub.com"    
    input_type: inline    
    db_name: SSISDB

Call Script With Input

- name: sqlcmd scripts
  uses : snsinahub/[email protected]
  with:
    sqlcmd_action: "script"
    sql_path: 'C:\scripts\run.sql' 
    server_name: "sql.snsinahub.com"
    sqlcmd_variables: env='dev' account='dev-account'
    input_type: inline
    query_timeout: 6000
    db_name: SSISDB