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 6703951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:13:56+00:00 2026-05-26T07:13:56+00:00

I have the following stored proc which uses a temp table to bulk import

  • 0

I have the following stored proc which uses a temp table to bulk import the data. I understand the temp tables are unique for every session, however i’m wondering if my application uses threads and makes multiple concurrent request to the stored proc, using the same sql connection from the application pool, will they end up referencing the same temp table?

CREATE PROCEDURE [dbo].[Mytestproc]
AS
  BEGIN
      BEGIN TRANSACTION

      CREATE TABLE #Hold
        (
           ID INT,
           VAL NVARCHAR(255)
        )

      BULK INSERT #Hold
        FROM 'C:\data.txt'
        WITH
          (
            FieldTermInAtOr ='|',
            RowTermInAtOr ='\n'
          )

      SELECT *
      FROM   #Hold

      DROP TABLE #Hold

      COMMIT TRANSACTION
  END 
  • 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-26T07:13:57+00:00Added an answer on May 26, 2026 at 7:13 am

    Whilst one thread is using a connection and executing this stored procedure, that same connection cannot be reused by the connection pool – so there’s no danger of sharing there. Other threads cannot use this connection, and will open new ones instead.

    In addition, there’s no need to drop the temp table before the stored procedure ends – temp tables created within a stored proc are dropped automatically when the proc is exited.

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

Sidebar

Related Questions

I have the following 3 rails classes, which are all stored in one table,
I have a stored proc in SQL Server 2005, which looks like the following
I have the following scenario: I have various user's data stored in my database.
So I have a stored procedure that does the following (modified out the data
I have the following issue: when a stored proc is called from my application,
I have a linq statement which calls a stored proc and returns a list
Hi i have the following stored proc in SQL Server 2005: ALTER PROCEDURE [dbo].[slot_sp_EngineerTimeslots_Group]
I have created the following stored procedure.. CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) ,
We have the following simple Stored Procedure that runs as an overnight SQL server
I have the following code within a stored procedure. WHERE WPP.ACCEPTED = 1 AND

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.