当前位置: 代码迷 >> Sybase >> 怎样判断某个表是否存在?该如何处理
  详细解决方案

怎样判断某个表是否存在?该如何处理

热度:8095   发布时间:2013-02-26 00:00:00.0
怎样判断某个表是否存在?
在Sybase数据库中用什么方法判断一个表的存在?
用什么存储过程?还是什么查询语句?

------解决方案--------------------------------------------------------
select 1 from sysobjects where name= 'tablename '
------解决方案--------------------------------------------------------
select 1 from dbo.sysobjects where name = :ps_tabname and type = 'U '
------解决方案--------------------------------------------------------
select name from sysobjects where name= "tablename" and type = "U"
------解决方案--------------------------------------------------------
if exists(select 1 from sysobjects where name = '表名' and type = 'U')
print "存在"
else
print "不存在"
  相关解决方案