判断数据表存在
判断存储过程存在
判断表字段存在
if exists (select 1
from sysobjects
where id = object_id('table1')
and type = 'U')
drop table table1
判断存储过程存在
IF OBJECT_ID(N'dbo.table1_Delete') IS NOT NULL
DROP PROCEDURE dbo.table1_Delete
判断表字段存在
if exists(select * from syscolumns where id=object_id('table1') and name='column1')
ALTER TABLE [table1] DROP COLUMN [column1]