How to change the port when calling sqlcmd

前端 未结 3 1617
走了就别回头了
走了就别回头了 2021-02-05 08:47

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

相关标签:
3条回答
  • 2021-02-05 09:02

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

    sqlcmd -S ComputerA,1691
    
    0 讨论(0)
  • 2021-02-05 09:08

    Following solution is working for me in SQL Server 2008 and above.

    sqlcmd -S "hostname or IP,port number" -U SA -P password

    0 讨论(0)
  • 2021-02-05 09:10

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

    0 讨论(0)
提交回复
热议问题