1 2 3 4 5 6 7 8 9 10 11 12 |
USE master; GO SELECT name, dbname FROM syslogins WHERE dbname = 'MyDatabase' ORDER BY dbname SELECT name AS LoginName, default_database_name FROM sys.server_principals WHERE default_database_name IS NOT NULL ORDER BY default_database_name |
Views – 1997