Sunday, February 19, 2012

dafult database is not master

Hello,

I'm a c# programmer and a SQL Server 2005 newby so...be gentle with me !
Here is my problem. I used to log on my computer with login A. while using this login, I've created a couple of databases on SQL SERVER Express with SQLServer managment studio express (FolkTaleDb, AdventureWork, etc...). One day, the ITManager changed my login access to my computer to LoginB (for some reason, LoginA is still activ in ActivDirectory so I can still use it). With that new login, I've only created one new database called TestSpatial. Well now, when I connect to SQLServer without explicitly mentionning the initial catalog in the connectionstring (I connect from my VS application), the default database is master when logged as LoginA, but TestSpatial when logged as LoginB ! I have to type explicitly 'master' (in my connectionstring) in order to connect to master instead of TestSpatial. How can I sort this out ?

Any help is welcomed !

David HILPIPRESue either the GUI to change your default database or the command sp_defaultdb.

Jens K. Suessmeyer:


http://www.sqlserver2005.de

No comments:

Post a Comment