SQL Server中有没有判断数据库中表是否存在的函数

解决方案 »

  1.   

    用一条sql语句就可以
    select isnull(objectproperty(object_id('用户表名'), 'IsUserTable'), 0)
    返回0不存在,返回1存在
      

  2.   

    if exists (select * from dbo.sysobjects where id = object_id(N'[tablename]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    ...............
    GO
      

  3.   

    select * from sysobjects where type='U' and name='判断的表名'
      

  4.   

    请问一下这些是SQL语法吗?还是MSSQL独有的?ACCESS数据库这样写行不行?