--資料表存在否
select * from dbo.sysobjects where id = object_id(N'[dbo].[資料表]')
and OBJECTPROPERTY(id, N'IsUserTable') = 1
--欄位存在否
IF exists (select * from sys.syscolumns where id=OBJECT_ID('Table')
and name='Column')
select 'exists'
else
select 'not exists'
沒有留言:
張貼留言