Object_ID('dbo.table1') is not null 为true时候说明表存在了  

解决方案 »

  1.   

    我这样子查过,
        对于用户表对象是可以的,对于临时表好像一直都 是 null
        ===============================
    可以测试一下:
         如:
          select f1,f2 into #tmp from mytable
          select object_id('dbo.#tmp')
         结果应该 是 null
    所以我才问.....
      

  2.   

    哈哈   object_id(里面要加上库名的,v如
      select object_id('tempdb..#temp');if exists (select * from tempdb..sysobjects where id = object_id('tempdb..#temp'))
    drop table #temp
      

  3.   

    有趣,十分关注,up up up
      

  4.   

    to qiubolecn(qiubole):
       谢谢了,只是分太少了点,不好意。。