0

I have a stored procedure which does the following:

  1. Create a temporary table (#tmp1) from a SELECT.. INTO.. FROM.. syntax.

  2. Build a querystring and execute it using EXEC(@STR1). The querystring also do a query to #tmp1.

The reason why the querystring is built on a string variable is because there are some condition in forming the query.

The problem now is because the 2nd query can't access #tmp1 since it's on different connection. I can create a global temporary table and drop it upon completion but am concerned on the implication when multiple users are triggering the stored procedure at the same time.

Appreciate ideas or workaround for this issue. Thank you in advance.

4

0 回答 0