views:

28

answers:

3

Hi Stakoverflow,

I need to detect a login's default database. Which system table/view should I query for that in SQL Server 2005?

+1  A: 

Try looking at master.sys.syslogins, dbname field.

Anthony Pegram
+1  A: 

You should be able to get this information for a specific login using sp_helplogins.

JeremyDWill
+1  A: 

The master.sys.syslogins view is provided for backward compatibility and will be removed in future. You should use sys.server_principals view and the column default_database_name.

Piotr Rodak