0

Say for an example if I created a procedure like below

CREATE PROCEDURE GETVALUES (@id INT)
AS
  BEGIN
      SELECT *
      INTO   #TEMPTABLE
      FROM   products
      WHERE  id = @id

      SELECT *
      FROM   #TEMPTABLE

      DROP TABLE #TEMPTABLE
  END  

If this procedure is run simultaneously by 3 or 4 users then will the data in #temptable collapse with other calls?

TT.
  • 15,774
  • 6
  • 47
  • 88
gazz
  • 1
  • 3
  • I started on an answer, then realized that there was a much better-written one already. VTC as a duplicate of that question/answer. – alroc Nov 08 '16 at 11:47
  • see the answer http://stackoverflow.com/a/18614467/6224406 – User Nov 08 '16 at 11:48
  • thank you i just thought that the temporary table created with a structure and the one i have given above are different – gazz Nov 08 '16 at 11:51
  • It will not collapse with other calls, because # tables are on connection level, if that table was global table (## table) it would collapse, because global tables are on server level – Veljko89 Nov 08 '16 at 11:52

0 Answers0