Udostępnij za pośrednictwem


A possible solution to a common sql error

If you happen to get the following sql error: 

 

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

 

You are not alone. There are a lot of solutions out on the web, the best i can find is this:

 

https://sequelserver.blogspot.com/2007/06/under-default-settings-sql-server-does.html

 

However, the error i am getting is actually because i have installed the full version of SQL without the SQL Express. However, my sql command was actually calling

 

sqlcmd -S localhost \sqlexpress -E -b –d databaseName -i sqlScriptPath

 

instead you need to call

 

sqlcmd -S localhost -E -b –d databaseName -i sqlScriptPath