SQL Server 2019 Database scoped configuration

sakuraime 2,326 Reputation points
2021-07-22T14:30:28.283+00:00

are there any good link / demo/ example for the following SQL Server 2019 Database

IDENTITY_CACHE
ISOLATE_SECURITY_POLICY_CARDINALITY
ACCELERATED_PLAN_FORCING
GLOBAL_TEMPORARY_TABLE_AUTO_DROP
VERBOSE_TRUNCATION_WARNINGS

thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,799 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmeliaGu-MSFT 13,976 Reputation points Microsoft Vendor
    2021-07-23T06:20:08.203+00:00

    Hi sakuraime,

    For GLOBAL_TEMPORARY_TABLE_AUTO_DROP option, you can try to create a global temporary table and not use it. By default (GLOBAL_TEMPORARY_TABLE_AUTO_DROP is on), the global temporary table will be deleted automatically. If you create a global temporary table when GLOBAL_TEMPORARY_TABLE_AUTO_DROP is off, the global temporary table needs to be deleted using the DROP TABLE statement, or it will be deleted when the server is restarted.

    Best Regards,
    Amelia


1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 111.2K Reputation points MVP
    2021-07-22T21:38:15.947+00:00

    For the first, try this:

       CREATE TABLE myidenttable(a int IDENTITY NOT NULL)  
       INSERT myidenttable DEFAULT VALUES  
    

    Next kill SQL Server through Task Manager and restart it. Insert a new row to the table. Notice the value. Then flip the setting of IDENTITY_CACHE and redo the exercise.

    For the last, try:

       CREATE TABLE myshortchar (a char(4))  
       INSERT myshortchar (a) VALUES ('Too long')  
    

    Then flip the switch for VERBOSE_TRUNCATION_WARNINGS and see the difference.

    As for links, did you look at https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql?view=sql-server-ver15?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.