So, recently a DBA is trying to tell us that we cannot use the syntax of
SELECT X, Y, Z
INTO #MyTable
FROM YourTable
To create temporary ta
That advice has been floating around for a long time:
Bottlenecks in SQL Server 6.5
Many people use a SELECT...INTO query to create a temporary table, something like this:
SELECT * INTO #TempTable FROM SourceTable
While this works, it creates locks against the tempdb database for the duration of the SELECT statement (quite a while if you are trawling through a lot of data in the source table, and longer still if the SELECT...INTO is at the start of a longer-running explicit transaction) While the lock is in place, no other user can create temporary tables. The actual location of the bottleneck is a lock on tempdb system tables. In later versions of SQL Server, the locking model has changed and the problem is avoided.
Fortunately, it was only a problem for SQL 6.5. It was fixed in 7.0 and later.