matt1
SSCommitted
Points: 1784
More actions
August 27, 2003 at 7:44 am
#59480
how can you use 'exist' to find a table and delete it?
Allen Cui-55137
SSC Guru
Points: 51650
August 27, 2003 at 7:46 am
#471598
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Customers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Customers]
GO
August 27, 2003 at 7:52 am
#471600
thanks allen
Calvin Lawson
SSChampion
Points: 11030
August 28, 2003 at 6:00 pm
#471894
Or, to bum it 🙂
If object_ID ('TableName') is not null
DROP table TableName
Signature is NULL
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply