SQL 临时表,总是提示“对象名#aa无效”。
ifobject_id('#aa')isnullbegincreatetableaa(nonumeric(19,6),Itemnvarchar(200))endifobj...
if object_id('#aa') is null
begin
create table aa(no numeric(19, 6),Item nvarchar(200))
end
if object_id('#aa') is not null
begin
insert into #aa
select haoma,wa
from table1 展开
begin
create table aa(no numeric(19, 6),Item nvarchar(200))
end
if object_id('#aa') is not null
begin
insert into #aa
select haoma,wa
from table1 展开
1个回答
展开全部
这儿为什么不用 #aa 了?
create table aa(no numeric(19, 6),Item nvarchar(200))
改了试试呢:
if object_id('#aa') is null
begin
create table #aa(no numeric(19, 6),Item nvarchar(200))
end
if object_id('#aa') is not null
begin
insert into #aa
select haoma,wa
from table1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询