declare @name varchar(20)select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('tablename') and b.id=a.cdefault and a.name='field1' and b.name like 'DF%'exec('alter table tablename drop constraint '+@name) alter table tablename drop column field1
你试试
alter table [2001计算机应用] drop column VB程序设计
但用ALERT就必须先删除DEFAULT,在删除列
alter table [13春机电(6)] drop constraint VB程序设计
ALTER TABLE [13春机电(6)] DROP COLUMN VB程序设计 大伙觉得我上面的语句是否可行?????理论上
select @name=b.name from syscolumns a,sysobjects b where a.id=object_id('你的表名') and b.id=a.cdefault and a.name='你有默认的的列名' and b.name like 'DF%' 这一句出错