Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Change default database

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2010-03-25 : 13:02:33

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

52326 Posts

Posted - 2010-03-25 : 13:03:41
use sp_defaultdb

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

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

Go to Top of Page
   

- Advertisement -