Get database scoped configuration values for the current database
Ever wondered how to check out the configurations specific to your SQL Server database? There's a handy system catalog view called sys.database_scoped_configurations that provides just what you need. This view lets you inspect various settings that are applied at the database level, giving you insights into how your database is configured.
For example, you can use the following SQL query to retrieve essential configuration details:
SELECT configuration_id ,name ,[value] AS [value_for_primary] ,value_for_secondary FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE);
This query will show you the configuration ID, its name, the primary value (value_for_primary), and if applicable, a secondary value (value_for_secondary). It's a quick way to get a snapshot of these important settings.
Want to dive deeper into what this view offers? You can find more comprehensive documentation on Microsoft's official site: sys.database_scoped_configurations (Transact-SQL).