Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 325857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:15:21+00:00 2026-05-12T09:15:21+00:00

So, recently a DBA is trying to tell us that we cannot use the

  • 0

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 tables in our environment, because that syntax causes a lock on TempDB for the duration of the stored procedure executing. Now, I’ve found a number of things that detail how temporary tables work, scope of execution, cleanup and the like. But for the life of me, I don’t see anything about blocking because of their use.

We are trying to find proof that we shouldn’t have to go through and do CREATE TABLE #MyTable… for all of our temporary tables, but neither side can find proof. I’m looking for any insight SO people have.

Additional Information

Currently working with SQL Server 2005, and soon to be SQL Server 2008 (Enterprise editions)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:15:21+00:00Added an answer on May 12, 2026 at 9:15 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've recently updated to Oracle 11g and our DBA has suggested using result caching
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's
I've been trying to specialize into the MS SQL server technologies, but my job
We have a .NET application talking to Oracle 10g. Our DBA recently pulled a
I have recently started a new job and noticed that all the SQL tables
Recently i've switched to PHP 5.3+ and after that migration i learned that the
Recently a client was concerned that their SWF was insecure because the XML path
Recently I've discovered CouchDB. I want to use CouchApp to build a flash games
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.