A ad Nov 20, 2005 #1 I want to create a Stored Procedure with program. If the Stored Procedure exist, I want to alter it. How can I do that?
I want to create a Stored Procedure with program. If the Stored Procedure exist, I want to alter it. How can I do that?
L luxspes Nov 20, 2005 #2 ad said: I want to create a Stored Procedure with program. If the Stored Procedure exist, I want to alter it. How can I do that? Click to expand... To delete an stored procedur (only if exists): IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PROCEDURENAME]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[PROCEDURENAME] To alter it: ALTER PROCEDURE PROCEDURENAME.... (and then the new body for the procedure) hope it helps...
ad said: I want to create a Stored Procedure with program. If the Stored Procedure exist, I want to alter it. How can I do that? Click to expand... To delete an stored procedur (only if exists): IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PROCEDURENAME]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[PROCEDURENAME] To alter it: ALTER PROCEDURE PROCEDURENAME.... (and then the new body for the procedure) hope it helps...