Temp Table usuage in a Multi User Environment

后端 未结 2 1433
我寻月下人不归
我寻月下人不归 2021-01-13 04:34

here\'s the situation:

I have an SSRS report that uses an SP as a Dataset. The SP creates a Temp Table, inserts a bunch of data into it, and select\'s it back out

相关标签:
2条回答
  • 2021-01-13 05:19

    A temp table with a single # is a local temporary table and its scope is limited to the session that created it, so collisions should not be a problem.

    0 讨论(0)
  • 2021-01-13 05:33

    Most likely not. If the temp table is defined as #temp or @temp, then you're safe, as those kind of temp tables can only be accessed by the creating connection, and will only last for the duration of the execution of the stored procedure. If, however, you're using ##temp tables (two "pound" signs), while those tables also only last for as long as the creating stored procedure runs, they are exposed to and accessible by all connections to that SQL instance.

    Odds are good that you're not using ##tables, so you are probably safe.

    0 讨论(0)
提交回复
热议问题