Configuring the Database
The database-level options configure the current database's behavior regarding ANSI compatibility and recovery.
Most database options can be set in Management
Studio within the Database Properties page, which you can find by
right-clicking a database in the console tree and choosing Properties
from the context menu. Figure 2 shows the Options tab.
The database configuration options can be set using T-SQL ALTER DATABASE SET options. The following example sets the AdventureWorks database to single user mode to obtain exclusive access.
ALTER DATABASE AdventureWorks SET SINGLE_USER;
View database configuration options using the sys.databases catalog view or the DATABASEPROPERTYEX() function. The following example returns all the database properties of the AdventureWorks database:
SELECT * FROM sys.databases WHERE name = ‘AdventureWorks';
Note
Do not use the sp_dboption system stored procedure because this has been removed in SQL Server 2012.