I need to detect a login's default database. Which system table/view should I query for that in SQL Server 2005?
To see the default collation for each character set, use the SHOW CHARACTER SET statement or query the INFORMATION_SCHEMA CHARACTER_SETS table. If COLLATE collation_name is specified without CHARACTER SET , the character set associated with collation_name and collation collation_name are used.
login can be an existing SQL Server login or a Windows user or group. If a login for the Windows user or group does not exist in SQL Server, it is automatically added. [ @defdb = ] 'database' Is the name of the new default database. database is sysname, with no default.
To view a list of databases on an instance of SQL Server. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. To see a list of all databases on the instance, expand Databases.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With