Skip to content
Sergio Govoni edited this page Oct 23, 2022 · 12 revisions

sqlcmdcli wiki!

sqlcmdcli utility is a command-line utility for ad hoc, interactive execution of commands on SQL Server to simulate specific workloads, anonymize sensitive data and much more.

Installation

You can find installation instructions on our README.

Commands

anonymizedb (anondb)

Anonymize all text columns longer than two characters!

sqlcmdcli.exe anonymizedb {options} [flags]

sqlcmdcli.exe anondb {options} [flags]

Options

-servername: (-s:) SQL Server instance name

-databasename: (-d:) Database name

-username: (-u:) SQL Server username

-password: (-p:) Password

-schemaname: (-schema:) The name of the table schema

-tablename: (-table:) The name of the table

-columnname: (-column:) The name of the column you want to anonymize

Options inherited from parent commands

-help Shows help for the command

Flags

-verbose Shows details about the results of running

Examples

sqlcmdcli.exe anonymizedb -servername:BEER -databasename:WideWorldImporters -username:YourUserName -password:YourPassword -verbose

sqlcmdcli.exe anondb -s:BEER -d:WideWorldImporters -u:YourUserName -p:YourPassword

querystoreworkload (qsw)

Runs a specific workload to reproduce a query's regression. It can be used to analyze the regression of a query with the SQL Server Query Store. Once the regression has been identified, it is possible to proceed with the manual forcing of the optimal execution plan!

sqlcmdcli.exe querystoreworkload {options} [flags]

sqlcmdcli.exe qsw {options} [flags]

Options

-servername: (-s:) SQL Server instance name

-databasename: (-d:) Database name

-username: (-u:) SQL Server username

-password: (-p:) Password

Options inherited from parent commands

-help Shows help for the command

Flags

-verbose Shows details about the results of running

-psp Activates the Parameter Sensitive Plan (PSP) Optimization workload

Examples

sqlcmdcli.exe querystoreworkload -servername:BEER -databasename:WideWorldImporters -username:YourUserName -password:YourPassword -psp -verbose

sqlcmdcli.exe qsw -s:BEER -d:WideWorldImporters -u:YourUserName -p:YourPassword

stressdb (sdb)

Extracts the database schema and runs a query for each table as fast as possible!

sqlcmdcli.exe stressdb {options} [flags]

sqlcmdcli.exe sdb {options} [flags]

Options

-servername: (-s:) SQL Server instance name

-databasename: (-d:) Database name

-username: (-u:) SQL Server username

-password: (-p:) Password

Options inherited from parent commands

-help Shows help for the command

Flags

-verbose Shows details about the results of running

Examples

sqlcmdcli.exe stressdb -servername:BEER -databasename:WideWorldImporters -username:YourUserName -password:YourPassword -verbose

sqlcmdcli.exe sdb -s:BEER -d:WideWorldImporters -u:YourUserName -p:YourPassword

altercolumn (altercol)

It alters a column with dependencies in your SQL Server database!

sqlcmdcli.exe altercolumn {options} [flags]

sqlcmdcli.exe altercol {options} [flags]

Options

-servername: (-s:) SQL Server instance name

-databasename: (-d:) Database name

-username: (-u:) SQL Server username

-password: (-p:) Password

-schemaname: (-schema:) The name of the table schema

-tablename: (-table:) The name of the table

-columnname: (-column:) The name of the column you want to modify

-columnrename: The new name you want to assign to the column

-datatype: (-type:) The new type you want to assign to the column

Options inherited from parent commands

-help Shows help for the command

Flags

-verbose Shows details about the results of running

Examples

sqlcmdcli.exe altercolumn -servername:BEER -databasename:AdventureWorks2017 -username:YourUserName -password:YourPassword -schemaname:Person -tablename:Person -columnname:FirstName -datatype:nvarchar(100) -verbose

Feedback

Thank you for checking out sqlcmdcli! Please open an issue to send us feedback. We're looking forward to hearing it.