Re: Cant find User Default database So, I can't Register my server

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 03/21/04


Date: Sun, 21 Mar 2004 16:47:35 -0600

You can run the OSQL command-line utility to specify an alternate database
context and execute sp_defaultdb to change the default database for a
login. For example:

OSQL -E -d master -Q"sp_defaultdb 'MyLogin', 'MyDatabase'"

-- 
Hope this helps.
Dan Guzman
SQL Server MVP
"Richard Muschamp" <***@custommicro.com> wrote in message
news:23D9DDF2-EE56-4B8B-8B03-264F006F0B35@microsoft.com...
> Occasionally, I disconnect a database. When I try to reconnect it, I get
the message that SQL "can't find the User default database".  Typically, I
reinstall the SQL Server software. There must be a better way.  Is there an
OSQL command I can use?    How can I recorver from this condition without
riinstalling SQL Server?
>
> Thanks, richard

Quantcast