the explanations says
The CREATE PROCEDURE statement cannot be combined with other Transact-SQL statements in a single batch. The same rule applies to Functions as well, but this is not noted in MSDN.
simplifying it a little bit .. "Create Procedure" can't be inside a BEGIN..END statement..
But Drop Procedure can be
so this will work..
IF OBJECT_ID('dbo.uspUSP') IS not NULL
drop PROCEDURE dbo.uspUSP
GO
so, as lokesh says .. Create a proc using dynamic query 😀 , With IF condition 😛
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm: