如题所述
SQL Serverä¸å¤æ表ä¸å段æ¯å¦åå¨ï¼
ããif exists
ãããããã(select * from syscolumns where name='colname1' and id=object_id('æ°æ®åºå.Owner.表å'))
ããããprint 'åå¨'
ããelse
ããããprint 'ä¸åå¨'
ã(代表表tablename1ä¸åå¨colname1å段 )
ä¾ï¼
ããselect * from syscolumns where name='Test' and id=object_id('dbo.test')
ããif exists
ãããããã(select * from syscolumns where name='colname1' and id=object_id('æ°æ®åºå.Owner.表å'))
ããããprint 'åå¨'
ããelse
ããããprint 'ä¸åå¨'
ã(代表表tablename1ä¸åå¨colname1å段 )
ä¾ï¼
ããselect * from syscolumns where name='Test' and id=object_id('dbo.test')
温馨提示:答案为网友推荐,仅供参考