Log på med Microsoft
Log på, eller opret en konto.
Hej
Markér en anden konto.
Du har flere konti
Vælg den konto, du vil logge på med.
Engelsk
Vi beklager. Denne artikel er ikke tilgængelig på dit sprog.

Symptoms

When you run a query that inserts the output of sys.database_scoped_configurations to a table variable or temporary table in Microsoft SQL Server 2016, and then select from that table variable or temporary table as seen in the example below, you may notice that there is only one entry for each database.

DROP TABLE IF EXISTS #h

CREATE TABLE #h(configuration_id INT, name sysname, value SQL_VARIANT, value_for_secondary SQL_VARIANT)

INSERT INTO #h(configuration_id, name, value,value_for_secondary)

SELECT * FROM sys.database_scoped_configurations D'

SELECT * FROM #h H

or

DECLARE @database_scoped_configurations TABLE(x INT);

INSERT INTO @database_scoped_configurations

SELECT configuration_id

FROM sys.database_scoped_configurations;

SELECT * FROM @database_scoped_configurations

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Resolution

This issue is fixed in the following cumulative update for SQL Server:

About cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Workaround

To work around this issue, you can add a TOP clause on the SELECT part of your insert to get the correct result. Here is an example:

DECLARE @database_scoped_configurations TABLE(x INT);

INSERT INTO @database_scoped_configurations

SELECT TOP 100 configuration_id

FROM sys.database_scoped_configurations

References

Learn about the terminology that Microsoft uses to describe software updates.

Har du brug for mere hjælp?

Vil du have flere indstillinger?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Var disse oplysninger nyttige?

Hvad påvirkede din oplevelse?
Når du trykker på Send, bliver din feedback brugt til at forbedre Microsoft-produkter og -tjenester. Din it-administrator kan indsamle disse data. Erklæring om beskyttelse af personlige oplysninger.

Tak for din feedback!

×