改一下: IF OBJECT_ID(N'tempdb..#tmp') IS NOT NULL DROP TABLE #tmp

解决方案 »

  1.   

    是不是总提示#tmp不存在 ?
    好像#tmp只在执行的时候才存在
    我猜的
    我一般用##tmp
      

  2.   

    你是不是有兩處以上的地方用到了SELECT * INTO #tmp From ...???
    比如:
     IF condition1
       SELECT * INTO #tmp From ....
     ELSE
       SELECT * INTO #tmp From ...???是否是這樣??
      

  3.   

    conn.Execute "if object_id(N'ybccp..#tmp_Tday') is not null drop table #tmp_Tday"
      conn.Execute "if object_id(N'ybccp..#tmp_Yday') is not null drop table #tmp_Yday"   conn.Execute "select * into #tmp_Tday from rcpkcb"            conn.Execute "select * into #tmp_Yday from rcpkcb "
      

  4.   

    N_Chow(一劍飄香) 的答案
    在我的sql server 2000 通过了
      

  5.   

    看一下:http://www.csdn.net/Expert/TopicView1.asp?id=588007