Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵狀

當您執行的查詢會插入 sys.database_scoped_configurations 到 Microsoft SQL Server 2016 中的資料表變數或臨時資料表,然後選取 [從該資料表變數] 或 [臨時] 表格如下列範例所示,您可能會發現每個資料庫只有一個專案。

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

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

狀態

Microsoft 已確認<適用於>一節所列的 Microsoft 產品確實有上述問題。

解決方案

此問題已在下列 SQL Server 累積更新中修正:

關於 SQL Server 的累積更新:

每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:

因應措施

若要解決此問題,您可以在插入的選取部分中新增 TOP 子句,以取得正確的結果。 以下是範例:

DECLARE @database_scoped_configurations TABLE(x INT);

INSERT INTO @database_scoped_configurations

SELECT TOP 100 configuration_id

FROM sys.database_scoped_configurations

參考

了解 Microsoft 用來說明軟體更新的術語

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×