default-database

How can I change my default database in SQL Server without using MS SQL Server Management Studio?

I dropped a database from SQL Server, however it turns out that my login was set to use the dropped database as its default. I can connect to SQL Server Management Studio by using the 'options' button in the connection dialog and selecting 'master' as the database to connect to. However when ever I try to do anything in object explorer i...

Protecting system databases in Sql Server Management Studio?

For the five hundredth time, I ran a sql script in management studio to add some tables to a database and FORGOT TO CHANGE THE DATABASE IT RUNS AGAINST. Since it defaults to master, I had to go and drop all the new tables I just added. I practically never run sql scripts against the master database or other system databases, yet in Man...