Friday, November 3, 2017

WITH EXECUTE AS

The user or login account is impersonated for the duration of the session or module execution, or the context switch is explicitly reverted.

CREATE PROCEDURE AccessMyTable
WITH EXECUTE AS 'Mary'
AS SELECT * FROM dbo.MyTable;

No comments:

Post a Comment

GEN AI

  Stay Tuned....