Friday, January 24, 2014

SQL Server - Connect to SQL server via internet connection

Determine what port your SQL server is listening on by running

USE master
GO
xp_readerrorlog 0, 1, N'Server is listening on'
GO

1433 is the default
Port forward this through your router/firewall

Connect to it by using a connection string in your odbc or code

Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=myUsername;Password=myPassword;

No comments:

Post a Comment