patternsqlMinor
Connect to SQL Server without specifying port
Viewed 0 times
specifyingwithoutconnectsqlportserver
Problem
I am trying to use what appears to be a rather badly written application which connects to an SQL Server database which I specify.
I cannot seem to connect to the SQL Server instance I wish to use without specifying the port with a comma e.g.
Now, the problem that this causes, and why I think the application is badly written, is that for some reason the application then thinks that the port number is the name of the database, and the server\instance name is
Now, I have used SQL Server instances before which did not require the port number to be specified. I know this must be some setting under the TCP/IP settings in SQL Server Configuration manager, and I have tried setting the port to the default 1433 as well as turning on dynamic ports, but neither of these have worked.
I am still fairly new to SQL Server, if anybody could point me in the right direction it would be greatly appreciated.
Edit
Having solved the problem as per Ste Bov's answer, I also now know why the application could not handle the port being specified. Internally, the application was storing its data in a temporary csv file and didn't bother to check input for commas or enclose it in quotes, so when it came to the port in the csv it thought it was the next field which was supposed to be the Database Name.
So yes, a badly written application indeed!
I cannot seem to connect to the SQL Server instance I wish to use without specifying the port with a comma e.g.
DBServer\DBInstance,Now, the problem that this causes, and why I think the application is badly written, is that for some reason the application then thinks that the port number is the name of the database, and the server\instance name is
DBServer\DBInstance. I believe it is not expecting to have to deal with a port number like this.Now, I have used SQL Server instances before which did not require the port number to be specified. I know this must be some setting under the TCP/IP settings in SQL Server Configuration manager, and I have tried setting the port to the default 1433 as well as turning on dynamic ports, but neither of these have worked.
I am still fairly new to SQL Server, if anybody could point me in the right direction it would be greatly appreciated.
Edit
Having solved the problem as per Ste Bov's answer, I also now know why the application could not handle the port being specified. Internally, the application was storing its data in a temporary csv file and didn't bother to check input for commas or enclose it in quotes, so when it came to the port in the csv it thought it was the next field which was supposed to be the Database Name.
So yes, a badly written application indeed!
Solution
@Ste Bov is correct, enable the SQL Server Browser Service on the server running SQL Server; however if for some reason you don't want to or cannot use that service, you can connect to the instance using the IP address and port number, like
TCP:x.x.x.x,y where x.x.x.x is the IP address, and y is the port. You can alternatively specify the connection as TCP:hostname,port, where hostname is just the server name (i.e. do not include the instance name).Context
StackExchange Database Administrators Q#118458, answer score: 5
Revisions (0)
No revisions yet.