Can I Pass connection string via SQLcmd?
I want to change application Name and failover partner (for mirroring) by connection string when use sqlcmd.
Now. When I use sqlcmd, application name of my connection set SQLcmd
in sys.sysprocesses result.
Open a Command Prompt window, and type sqlcmd -SmyServer\instanceName. Replace myServer\instanceName with the name of the computer and the instance of SQL Server that you want to connect to. Press ENTER. The sqlcmd prompt (1>) indicates that you are connected to the specified instance of SQL Server.
Using a non-standard portServer=myServerName,myPortNumber;Database=myDataBase;User Id=myUsername;Password=myPassword; The default SQL Server port is 1433 and there is no need to specify that in the connection string.
The sqlcmd utility is available with the Microsoft ODBC Driver for SQL Server on Linux and macOS.
Not as far as I know - perhaps consider using osql, with the -D parameter and set up an ODBC connection, which would get you failover partner support at least.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With