Freigeben über


Erstellen und Zugreifen auf Tabellen in TempDB aus nativ kompilierten gespeicherten Prozeduren

Das Erstellen und Zugreifen auf Tabellen in TempDB aus nativ kompilierten gespeicherten Prozeduren wird nicht unterstützt. Verwenden Sie stattdessen Tabellentypen und Tabellenvariablen. Beispiel:

CREATE TYPE dbo.OrderQuantityByProduct   
  AS TABLE   
   (id INT NOT NULL PRIMARY KEY NONCLUSTERED HASH WITH (BUCKET_COUNT=100000),   
    ProductID INT NOT NULL,   
    Quantity INT NOT NULL) WITH (MEMORY_OPTIMIZED=ON)  
GO  
CREATE PROCEDURE dbo.usp_OrderQuantityByProduct   
WITH NATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER  
AS BEGIN ATOMIC WITH   
(  
    TRANSACTION ISOLATION LEVEL = SNAPSHOT,  
    LANGUAGE = 'english'  
)  
  -- declare table variables for the list of orders   
  DECLARE @Input dbo.OrderQuantityByProduct  
  
  -- populate input  
  INSERT @Input SELECT ProductID, Quantity FROM dbo.[Order Details]  
  end  

Siehe auch

Migrationsprobleme für nativ kompilierte gespeicherte Prozeduren
Transact-SQL Konstrukte, die von In-Memory OLTP nicht unterstützt werden