How to Connect to SQL Server Running on Non Standard Port
April 2nd, 2009 by Andrew Chen
Well it took me a while to figure out the easiest way to connect to a SQL server listening on a non standard port. The standard sql server port is 1433. When you connect
One way to do that is to insert an entry using SQL Server client network utility and specify the port corresponding to the SQL Server you want to connect to. The easiest however way is to embed the port number in the SQL Server name. But how? An almost universal format to specify port with host name is in this way, “ServerName:ServerPort”. For instance 127.0.0.1:1433. However SQL Server doesn’t take this format. It has its own format, “ServerName, ServerPort”. For example 127.0.0.1,1433. So next time when you connect to a SQL Server listening on a non standard port you can put the server name and port number together in above format and place it into where you usual enter the SQL Srver name. It works perfect for both Enterprise Manager and Query Analyzer. And I recalled that was one of the interview question I was asked when I was looking for a job last year.


No comments yet.