I know - I should have this memorized. And it doesn't deal with schemas.
IF EXISTS
(
SELECT * FROM databasename.dbo.sysobjects
WHERE id = OBJECT_ID(N'tablename')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1
)
DROP TABLE databasename.dbo.tablename
Friday, January 29, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment