Sep 18, 2013

Create a natively compiled stored procedure by ssms in sql server 2014

This post explain how to create a very simple natively compiled stored procedure in sql server 2014

Before creating the natively compiled stored procedure you have to create memory optimized database. If you not created yet then go through the following link:

Very simple script to create natively compiled stored procedure:

USE Memory_DB

CREATE PROCEDURE uspGetEmployee(
     @ntEmpID AS BIGINT
)
WITHNATIVE_COMPILATION, SCHEMABINDING, EXECUTE AS OWNER
AS BEGIN ATOMIC WITH
(
 TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'us_english'
)

     SELECT vcName,moSalary FROM dbo.tblEmployee 

END


Note: Here Memory_DB is memory optimized database and tblEmployee is memory optimized table.

No comments:

Post a Comment