Re: SQL connection problem

From: Uri Dimant (urid_at_iscar.co.il)
Date: 02/17/05


Date: Thu, 17 Feb 2005 15:04:45 +0200

John
You need to run
EXEC sp_defaultdb 'John', 'pubs'

Detach the database and delete the LOG file.

EXEC sp_detach_db @dbname = 'pubs'
EXEC sp_attach_single_file_db @dbname = 'pubs',
   @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

"John Almeda" <jalmeda@northsouth.net> wrote in message
news:OgECTCPFFHA.2540@TK2MSFTNGP09.phx.gbl...
> I have sql 2000. Last night I had a backup problem where the Log would
> not restore becasue it was the wrong one. This left my DB greyed out. In
> my great wisdom I did a not so wise thing and detached the DB and tried
> to re-attach. No luck. Next thing I know I cannot connect to the server
> becasue "Cannot open user default db. Login failed" . I have tried
> everything short of moving a very large db and re-installing sql and
> then trying to attach or restore the data. IS there an easier/another
> way.
>
> John Almeda
> System Adm
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Relevant Pages