Are temporary tables thread-safe?

前端 未结 9 549
清酒与你
清酒与你 2021-02-05 00:10

I\'m using SQL Server 2000, and many of the stored procedures it use temp tables extensively. The database has a lot of traffic, and I\'m concerned about the thread-safety of cr

9条回答
  •  攒了一身酷
    2021-02-05 00:46

    Local-scope temp tables (with a single #) are created with an identifier at the end of them that makes them unique; multiple callers (even with the same login) should never overlap.

    (Try it: create the same temp table from two connections and same login. Then query tempdb.dbo.sysobjects to see the actual tables created...)

提交回复
热议问题