I need to detect a login's default database. Which system table/view should I query for that in SQL Server 开发者_高级运维2005?
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.
You should be able to get this information for a specific login using sp_helplogins.
精彩评论