Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the port when calling sqlcmd

Tags:

sql

sqlcmd

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.

like image 681
Matt Elhotiby Avatar asked May 23 '11 16:05

Matt Elhotiby


2 Answers

According to this MSDN link, you'd use -S tcp:servername,32001.

like image 97
dmc Avatar answered Sep 24 '22 07:09

dmc


That's it: How to Connect to the Database Engine using sqlcmd. Something like this:

sqlcmd -S ComputerA,1691
like image 33
Alireza Maddah Avatar answered Sep 22 '22 07:09

Alireza Maddah