/*判断该表是否已经存在*/
if exists ( select * from sys.objects where name ='表名')
print '表存在'
else
print '表不存在'
if exists(select * from syscolumns where name='字段名' and id=object_id('表名'))
print '字段名存在'
else
print '字段名不存在'
--修改表字段类型
ALTER TABLE 表名 ALTER COLUMN 字段名 数据类型
ALTER TABLE User ALTER COLUMN name varchar(150)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[存储过程名]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[存储过程名] --删除存储过程
可以修改,但是不建议