Sunday, March 11, 2012

Alter Stored Procedure

Hi all,

I use SQL2005 and I recently noticed this...

When I right click a stored procedure and select modify I get something like this

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[xxxxxx]') AND type in (N'P', N'PC'))

BEGIN

EXEC dbo.sp_executesql @.statement = N'

xxx xxx xxx'

instead of the usual alter procedure...

I think that this happened after I installed SP2 (which I cannot remove)

Why this is happening and how can I revert it to the old way of altering stored procs?

In SSMS click Tools > Options then Scripting on the left. "Object Scripting options" section set "Include IF NOT EXISTS clause" to false.

No comments:

Post a Comment