select ID=identity(int, 1, 1), * into #T from Table
select * from #T
drop table #T
本文介绍了一种使用 SQL 创建并操作临时表的方法。通过示例展示了如何利用 T-SQL 的 SELECT INTO 和 DROP TABLE 语句来创建和删除临时表 #T。此过程包括插入数据到临时表以及从该表中检索所有记录。
select ID=identity(int, 1, 1), * into #T from Table
select * from #T
drop table #T
3558

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