判斷表TextTable中是否存在列IsUpdate,如果不存在則向表中添加列,并且數(shù)據(jù)類型為int
if(not exists(select * from syscolumns where name = 'IsUpdate' and id in
(select id from sysobjects where id = object_id(N'[TestTable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)))
alter table [TestTable] add [IsUpdate] [int];