|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to dertiminateI want to create a Stored Procedure with program.
If the Stored Procedure exist, I want to alter it. How can I do that? ad wrote:
> I want to create a Stored Procedure with program. To delete an stored procedur (only if exists):> If the Stored Procedure exist, I want to alter it. > How can I do that? > > 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... |
|||||||||||||||||||||||