IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(‘table2′) AND type = ‘U’)
DROP TABLE table2
create table table2(lname varchar(20))
Note: type=’U’ means the object type is for table
Posted by Sudeep Pandey on November 14, 2009
IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(‘table2′) AND type = ‘U’)
DROP TABLE table2
create table table2(lname varchar(20))
Note: type=’U’ means the object type is for table
Posted in SQL Server | Leave a Comment »