How to dertiminate

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I want to create a Stored Procedure with program.
If the Stored Procedure exist, I want to alter it.
How can I do that?
 
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?
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...
 
Back
Top