SQL2008 已删除了临时表为什么还是会提示已存在
写了查询语句:declare@avarchar(10)set@a=aif@aisnullbeginifobject_id('tempdb..#1')isnotnulldr...
写了查询语句:
declare @a varchar(10)
set @a=a
if @a is null
begin
if object_id('tempdb..#1') is not null
drop table #1
select * into #1 from table_f
end
else
begin
if object_id('tempdb..#1') is not null
drop table #1
select * into #1 from table_f where a=@a
end
运行的时候会提示:数据库中已存在名为‘#1’的对象 展开
declare @a varchar(10)
set @a=a
if @a is null
begin
if object_id('tempdb..#1') is not null
drop table #1
select * into #1 from table_f
end
else
begin
if object_id('tempdb..#1') is not null
drop table #1
select * into #1 from table_f where a=@a
end
运行的时候会提示:数据库中已存在名为‘#1’的对象 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询