Arthur
Arthur

Reputation: 51

Change the application name of sqlcmd

I am using sqlcmd command line to connect to a database. I want to change the application name so that I can have multiple processes using sqlcmd, and be able to differentiate these processes from the server side. I know in SQL Server Management Studio I could do this (Change the Application Name of SSMS), but how can I do this in command line?

I checked the sqlcmd -?, but didn't find any useful parameter. There is another command line tool bcp, but I don't find any useful info there either.

Upvotes: 1

Views: 610

Answers (1)

TOS
TOS

Reputation: 360

The flag -H can be used to set "workstation_name". It's is not the application name, but can serve the same purpose. Use SELECT HOST_NAME() to get the value.

Upvotes: 1

Related Questions