Wednesday, December 31, 2008

Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.


  1. Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.


          Use surface area configuration tool, to allow remove connections.


 




  1. Turn on the SQL Server Browser service.


(Start -> Run -> Services.msc -> start the SQL Server browser services)


 




  1. Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.


 


For SQL Server Service (MSSQLServer)


Start -> Settings -> Control Panel -> Network Connections -> Active Connections -> Properties - Advanced Tab -> Windows Firewall Settings - Add Port -> In the Name text box type SQL Server Instance Name -> in the PORT number text box type 1433 -> Select TCP/IP -> OK


 


For SQL Browser Service


Start -> Settings -> Control Panel -> Network Connections -> Active Connections -> Properties - Advanced Tab -> Windows Firewall Settings - Add Port -> In the Name text box type SQL Server Browser Service -> in the PORT number text box type 1434 -> Select UDP -> OK


 

1 comment:

  1. Hi


    Pls try this also


    http://sqlservererror-info.blogspot.com/2009/07/error-has-occurred-while-establishing.html

    ReplyDelete