I have a scenario where a Multithreaded .net application calls a stored procedure which in turn uses a temp table in it.
In our application concurrently we are calling four threads which individually triggers the same stored procedure. In this stored procedure we are creating the temp table using the INTO keyword.
SELECT * INTO #TempTable
But the application was getting locked and the second thread was no longer completing. Then we tried replacing the Temptable with a table variable and we succeeded in this attempt. But I am not convinced with the table variable since I am looking at huge data volume. Can anyone have any approach to get around this.