1、判断“表”是否存在:
if exists (select * from sysobjects where id = object_id(N'[dbo].[表名]'and OBJECTPROPERTY(id, N'IsUserTable'= 1
  
print '存在'
else
  
print '不存在'

2、判断“存储过程”是否存在:
if exists(select   1   from   sysobjects   where   id=object_id('所有者.存储过程名')   and   xtype='P')   
  print   
'存在'   
else   
  print   
'不存在' 

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2022-02-05
  • 2021-12-29
  • 2021-12-15
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2022-02-02
  • 2021-09-19
  • 2021-12-01
  • 2021-12-03
  • 2022-12-23
  • 2022-02-15
  • 2021-12-19
相关资源
相似解决方案