Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help, SQL Server 8.0 deleted default datbase 1

Status
Not open for further replies.

commatom

Programmer
Aug 30, 2007
54
US
Hello-

I have a Sql server 8.0 database which the default database has been deleted. I need to figure out how to change the default database so I can connect and repair everything. I have seen information all over the place for more recent versions of SQL Server but not 8.0.

Thank you in advance
 
8?
Isn't that 2000?
What is your default database?

Connect to master.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
You should be able to correct this by using the osql utility.

Click Start -> Run
Type CMD
Click OK

At the command prompt, type:

[tt][blue]
osql -U[!]MyLoginName[/!] -P[!]MyPassword[/!] -S[!]MyServerName[/!] -dMaster
[/blue][/tt]

You should get a 1> prompt

If you do, type this...

[tt][blue]
sp_defaultdb '[!]MyLogin[/!]','Master'
[/blue][/tt]

Press ENTER
Type GO
Press ENTER (again)

The default database for 'MyLogin' has just been changed to the master database.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Great, this worked... I couldn't find the osql piece. Everywhere I looked to sqlcmd.

So my next problem is when I log into SQL Enterprise Manager it uses windows authentication....how do I change the default for that?
 
I haven't used Enterprise Manager in years. I don't know. Sorry.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I got it working, I chaged the default database for SA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top