创建临时表
--判断临时表是否存在
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#TEMP_TBL') and type='U')
begin
truncate table #TEMP_TBL
end
ELSE
begin
create table #TEMP_TBL(
ID int IDENTITY (1,1) primary key not null, --创建列ID,并且每次新增一条记录就会加1
xjh nvarchar(max),
zf nvarchar(100)
);
end
浙公网安备 33010602011771号