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.