Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

SQL Server does not allow remote connection

with 3 comments

I am working on MSBuild task and want to connect osql.exe to remote machine’s sql server. I got following errors.

[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.

I am running the following command

osql -U elm -P admin123 -S “Testng-Server\Cygnet” -d ELM_Test -n -b -i “E:\Projects\HOBO1\ELM01\Source\ELM01.Database\DataScript\PopulateData.sql”

It is strangge but when i add host into the command line it worked.

osql -U elm -P admin123 -S “Testng-Server\Cygnet” -h “testing-server\cygnet”  -d ELM_Test -n -b -i “E:\Projects\HOBO1\ELM01\Source\ELM01.Database\DataScript\PopulateData.sql”

I got similar problem while connecting to sql server but i don’t know what the solution in it. I will apply above solution once I got that error again. Hope wont get it again πŸ˜›

Advertisements

Written by Manish

March 13, 2007 at 1:39 pm

Posted in Uncategorized

3 Responses

Subscribe to comments with RSS.

  1. Nice Manish! keep updating it with lotta infos!

    Guruprasad Balaji

    June 22, 2010 at 5:49 pm

  2. This issue over the top with the issue “SQL Server does not allow remote connection” is bcoz u didnt allow the TCP/IP access available in the Surface Area Configuration of the SQL server!

    Guruprasad Balaji

    June 22, 2010 at 5:51 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: