Reputation: 44066
I have this command
sqlcmd.exe -E -i "C:\joe-db-scripts\joe-db-tasks.Install.sql"
and I need to add the specific non-standard port of 32001. How do I do that? I was thinking of some flag like -p
or something but I don't know the syntax.
Upvotes: 28
Views: 33691
Reputation: 21
Following solution is working for me in SQL Server 2008 and above.
sqlcmd -S "hostname or IP,port number" -U SA -P password
Upvotes: 2
Reputation: 1
Mayo/23/2022, works
sqlcmd -S "hostname or IP,port number"
SQL Express 2019 from linux ubuntu client connecting to sql express on windows server
Upvotes: 0
Reputation: 5885
That's it: How to Connect to the Database Engine using sqlcmd. Something like this:
sqlcmd -S ComputerA,1691
Upvotes: 6