Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Stored Procedure, "WITH EXEC AS CALLER"

$
0
0

I'm reviewing a stored procedure some one else wrote.

Right before the variable declarations (DECLARE) and right after the parameters they wrote the following:

WITH EXEC AS CALLER
AS

What does this do, exactly? I've looked at stored procedure tutorials and examples and none of them use this.

Here is more of the code snippet if need be.

USE [Database1]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[RagGetIt]

@initials nvarchar(3), @state nvarchar(2)

WITH EXEC AS CALLER
AS

DECLARE
   @var1    INT,
   @var2    INT,
   @var3    INT,
Also, is there a point of having those three 'GO' statements in the beginning, or is GO just supposed to go at the end of the procedure's code?


-Nothing to see. Move along.



Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>