A small correction to Dan and Tibor: In SQL 2014 EXECUTE AS OWNER was mandatory. They removed that requirement in SQL 2016. But this can explain why it still appears in some samples.
SQL Server in-memory : Native compile with Execute as Owner
sakuraime
2,351
Reputation points
May i know is it a must to mention Execute as Owner during the creation of native compile sp ? I can create without Execute as Owner .
SQL Server | Other
Answer accepted by question author
-
Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator2020-10-23T21:58:30.413+00:00
2 additional answers
Sort by: Most helpful
-
Dan Guzman 9,411 Reputation points2020-10-23T09:57:23.143+00:00 The EXECUTE AS clause is not required for natively compiled stored procedures. The syntax diagram for natively compiled stored procedures in the CREATE PROCEDURE documentation page shows the clause in square brackets, indicating it is optional.
-
tibor_karaszi@hotmail.com 4,316 Reputation points
2020-10-23T10:02:01.44+00:00 It is not a must. I can also create without specifying EXECUTE AS.