CReate PROCEDURE parsetest(@str varchar(8000)) AS begin DECLARE @parseonoff AS VARCHAR(50) BEGIN try --PRINT @str SET @str = 'SET PARSEONLY ON; ' + @str EXEC (@str) set @parseonoff = 'SET PARSEONLY OFF; ' exec (@parseonoff + 'Select 1') -- FROM dbo.Rostering END TRY BEGIN catch set @parseonoff = 'SET PARSEONLY OFF; ' exec (@parseonoff + 'Select 0') --SET PARSEONLY off END CATCH END
DECLARE @str VARCHAR(1111) --DECLARE @a INT SET @str = 'SELECT 1' --SET PARSEONLY ON EXEC parsetest @str
DECLARE @str VARCHAR(1111) --DECLARE @a INT SET @str = 'SELECT bbb(1)' --SET PARSEONLY ON EXEC parsetest @str
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)