Unix Technical Forum

MS SQL connection could not be established

This is a discussion on MS SQL connection could not be established within the SQL Server forums, part of the Microsoft SQL Server category; --> John Almeda System Adm It seems that I have done something really stupid or something went boonkers. I was ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 06:13 AM
John Almeda
 
Posts: n/a
Default MS SQL connection could not be established



John Almeda
System Adm

It seems that I have done something really stupid or something went
boonkers. I was restoring a DB whn I got a message that the log file
could not be restored because it was XXXXXX????. This left my DB greyed
out and with a (loading) sign. I tried to detach and then re-attech the
DB and all hell broke loose. Now I cannot connect to any of my DB's. The
message I get is "a connection could not be established on sqlsrvr .
Cannot open users default db. Login failed."

I cannot see any of db under that regitration and the connection
continues to fail. I am drawing a total blank as to why and how to
correct with the exception of unistalling MSSQL and re-installing the
server and then trying to establish a connection with my db's again.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 06:13 AM
Simon Hayes
 
Posts: n/a
Default Re: MS SQL connection could not be established

You can connect and change your default database to master using osql:

osql -S MyServer -E -d master -Q"exec sp_defaultdb 'MyLogin', 'master'"

That should allow you to connect to the server as usual, and then you
can try restoring your database again - if you still have problems at
that point, it would be useful to see the exact error message.

Simon

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:39 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com