cannot opon user default database    emergency

CASorter
CASorter used Ask the Experts™
on
i had a log file that was full.

normally you can delete the log file if you detach the database .  delete the log  then reattach the database.

well.. like a doofus  i stopped the server... deleted the log file and then tried to restart the server.

no matter what i do   windows authentication,  sql authentication

cannot open user default database

i tried osql at command prompt

osql -U username
it asked for password...  good sign,   but when i put in the password

cannot open user default database

tried
osql -E
cannot open user default database

the only file i deleted was the dbname_log.ldf file

pleaes help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
ok
i was able to get in using isqlw  and putting in the master database as the connection

the database i was looking for was not in the drop down for the databases

i tried to attach it,  said it already existed

i tried to detatch it  said it could not detatch cleanly

i tried to reattach it again.
said .ldf file was wrong

i am getting close...

any other suggestins would be appreciated
hi,
have a look at this post :
http://www.tek-tips.com/faqs.cfm?fid=6260
Top Expert 2012

Commented:
>>normally you can delete the log file if you detach the database .  delete the log  then reattach the database.<<
As I have mentioned to you before this is a very bad idea.  You do it at your own peril.
Top Expert 2012

Commented:
Here is another Hail Mary link:
Recovering from a deleted log file on SQL Server
http://www.spaceprogram.com/knowledge/sqlserver_recover_from_deleted_log.html

If that does not do it for you, than you may want to start searching for your backups.  I trust you have backups, right?

Author

Commented:
i would hug you if i could

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial