且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MS SQL中的Temporay表

更新时间:2023-02-05 08:36:55

MS SQL中有两种类型的临时表
一个是本地临时表,另一个是全局临时表.
#xxxx是本地临时表,可以在创建它们的相同存储过程中对其进行访问.要在不同的存储过程中使用,请使用全局临时表.
您可以像## xxxx这样创建它们.
在连接数据库之前,该表一直存在.一旦断开连接,该表将被删除.
There are two types of temporary table in MS SQL
one is Local temporary table and other one is Global temporary table.
#xxxx is the local temporary table which can be accessed in the same stored procedure in which you are creating them. To use in different stored procedures use Global temporary table.
You can create them like ##xxxx.
This table exists till you have connection the the database. Once you disconnect the table will be dropped.