SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Change default database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dr223
Constraint Violating Yak Guru

361 Posts

Posted - 03/25/2010 :  13:02:33  Show Profile  Reply with Quote

Hi,

I am working with Sql management studio 2005, when I select new query the default database is set to "master". I have to drop down to select the database I want to make a query from.

Instead of "master" I want to change the default database to "mydb". So that when I next select new query it sets the default database to "mydb".

Any help please..

Thanks

visakh16
Very Important crosS Applying yaK Herder

India
47189 Posts

Posted - 03/25/2010 :  13:03:41  Show Profile  Reply with Quote
use sp_defaultdb

http://msdn.microsoft.com/en-us/library/ms181738.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000