create table #temp
(
id int identity(1,1),
customer nvarchar(50)
(
id int identity(1,1),
customer nvarchar(50)
)
selectidentity(int ,1,1) as id,*into #temp1 fromtachecontractid --#temp1没有提前声明
所以比较可靠的做法,还是先判断临时表是否存在,然后再drop table if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U') drop table #tempcitys
本文介绍了使用SQL创建临时表的方法,并提供了示例代码。同时,文中还讨论了如何检查临时表的存在状态以及如何安全地删除这些表。
2995

被折叠的 条评论
为什么被折叠?



