-
if exists DROP PROCEDURE/VIEW
how can I drop a propcedure or a view without error for MS SQL 2000/2500
for a table
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[myTABLE]') AND type in (N'U'))
DROP TABLE [dbo].[myTABLE]
and for a procedure
IF EXISTS ???
DROP PROCEDURE [dbo].[SP_myTABLE_Count]
thank you for helping
-
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SP_myTABLE_Count]') AND type in (N'P'))
DROP PROCEDURE [dbo].[SP_myTABLE_Count]
-
thank you skhanal
for a view is it ?
AND type in (N'V'))
Last edited by anselme; 05-20-2007 at 10:41 AM.
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|