jonathanfox82.mssql-tools

Role Name

=========

MSSQL Tools for Linux

This role provides tools for connecting to MSSQL databases on Linux without needing to install a full SQL Server instance. It is helpful for executing SQL queries through Ansible shell commands.

Using sqlcmd

Here are the basic options for using sqlcmd:

  • -a packet_size : Specify the size of packets.
  • -A : Connect using a dedicated administrator connection.
  • -b : Stop the batch job if there’s an error.
  • -c batch_terminator : Define a batch terminator.
  • -C : Trust the server's certificate.
  • -d db_name : Specify the database name.
  • -e : Echo the input.
  • -E : Use a trusted connection.
  • -f : Set codepage for input/output.
  • -g : Enable column encryption.
  • -G : Use Azure Active Directory for login.
  • -h rows_per_header : Specify number of rows per header.
  • -H workstation_name : Set the workstation name.
  • -i input_file : Provide an input file.
  • -I : Enable quoted identifiers.
  • -j : Print raw error messages.
  • -k[1 | 2] : Remove or replace control characters.
  • -K application_intent : Set application intent.
  • -l login_timeout : Set timeout for login.
  • -L[c] : List servers with optional clean output.
  • -m error_level : Specify error level.
  • -M : Enable multi-subnet failover.
  • -N : Encrypt the connection.
  • -o output_file : Specify an output file.
  • -p[1] : Print statistics in optional colon format.
  • -P password : Provide the password.
  • -q "cmdline query" : Execute a command line query.
  • -Q "cmdline query" : Execute a command line query and exit.
  • -r[0 | 1] : Send messages to standard error (stderr).
  • -R : Use regional settings of the client.
  • -s col_separator : Set column separator.
  • -S [protocol:]server[instance_name][,port] : Specify server and instance.
  • -t query_timeout : Set timeout for queries.
  • -u : Use a Unicode output file.
  • -U login_id : Specify the login ID.
  • -v var = "value" : Define a variable and its value.
  • -V error_severity_level : Specify severity level of errors.
  • -w column_width : Set the width of columns.
  • -W : Remove extra spaces from the end.
  • -x : Disable variable substitution.
  • -X[1] : Disable commands and scripts, with optional exit.
  • -y variable_length_type_display_width : Set display width for variable types.
  • -Y fixed_length_type_display_width : Set display width for fixed types.
  • -z new_password : Set a new password.
  • -Z new_password : Set a new password and exit.
  • -? : Display usage information.

Requirements


No special requirements.

Role Variables


No variables needed.

Dependencies


No dependencies.

Example Playbook


- hosts: servers
  roles:
     - { role: jonathanfox82.mssql-tools }

License


BSD License.

Informazioni sul progetto

Simple role to install MSSQL Tools on Linux Red hat only for now.

Installa
ansible-galaxy install jonathanfox82.mssql-tools
Licenza
Unknown
Download
76
Proprietario
Infrastructure Engineer writing C#, PowerShell, Ansible scripts for automation.