Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Unable to load sample DB to SQL 2005

Author  Topic 

Wylbur
Starting Member

29 Posts

Posted - 2010-03-15 : 23:40:46

Hi all;

I am trying to load the "pubs" sample database to MS SQL 2005 using the osql utility,
and I am having some problems.

I tried the command with an active server instance specified
within the command,

osql -E -S SAM-V01\\SQL2005D-01 -Q "EXEC sp_attach_db N'pubs' N'c:\SQL Server 2000 Sample Databases\pubs.mdf'"

I got the following error:
-------------------------------------------------------------------
[SQL Native Client]Client unable to establish connection due to prelogin
failure
-------------------------------------------------------------------

I tried the command without an active server instance being specified
within the command,

osql -E -Q "EXEC sp_attach_db N'pubs' N'c:\SQL Server 2000 Sample Databases\pubs.mdf'"


I got the following error:
-------------------------------------------------------------------
[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL
Server [2].
[SQL Native Client]Login timeout expired
[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.
-------------------------------------------------------------------


In Server properties > Connections,
"Allow remote connections to this server" is checked

Can anyone tell me what I am missing here?

Thanks!!!





Wylbur
========================

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-03-16 : 03:08:40
Could this be the problem...? ->

SAM-V01\\SQL2005D-01

replace with

SAM-V01\SQL2005D-01

Are you sure that "SQL2005D-01" is the correct instance name?



- Lumbago
If the facts don't fit the theory, change the facts. Albert Einstein
Go to Top of Page

Wylbur
Starting Member

29 Posts

Posted - 2010-03-16 : 13:15:56

Hi Lumbago;


quote:
Originally posted by Lumbago

Could this be the problem...? ->

SAM-V01\\SQL2005D-01

replace with

SAM-V01\SQL2005D-01



AH!

I should have mentioned that I am running this from a batch file,
and two slashes are needed to get one.

My bad.


quote:

Are you sure that "SQL2005D-01" is the correct instance name?



Yes.

Thanks for the attention!





Wylbur
========================
Go to Top of Page
   

- Advertisement -