你是不是有兩處以上的地方用到了SELECT * INTO #tmp From ...??? 比如: IF condition1 SELECT * INTO #tmp From .... ELSE SELECT * INTO #tmp From ...???是否是這樣??
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 "
好像#tmp只在执行的时候才存在
我猜的
我一般用##tmp
比如:
IF condition1
SELECT * INTO #tmp From ....
ELSE
SELECT * INTO #tmp From ...???是否是這樣??
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 "
在我的sql server 2000 通过了