相关文章推荐
另类的砖头  ·  testandset指令 - CSDN文库·  4 月前    · 
腼腆的水桶  ·  Errno 9: Bad file ...·  9 月前    · 
爱逃课的葡萄酒  ·  Amazon Live·  1 年前    · 
谦和的蘑菇  ·  winforms c# how to ...·  1 年前    · 

1.字段是否存在

if((select count(*) from syscolumns where name = '字段名' and id=(select id from sysobjects where name='表名'))=0)
begin

2.表是否存在

if exists (select * from sysobjects where id = OBJECT_ID('表名') and OBJECTPROPERTY(id, 'IsUserTable') = 1)
DROP TABLE 表名