temporary tables in stored procedures

Posted on 2005-04-21
Last Modified: 2010-03-19

im using temporary tables in my stored procedure.  i drop these tables at the end of the stored procedure.
how can i make this table such that it will not be used by another instance of the stored procedure when run from another client.

thanks in advance.
Question by:3Mann
    LVL 30

    Accepted Solution


    #table means local temp table, only used by the current process

    ##table means global temp table that can be used by any process

    so as long as you only use one # at the start you should be OK.
    LVL 1

    Author Comment

    ic :) thanks
    LVL 1

    Author Comment


    cud i do it like [dbo].[#temptable] ?
    LVL 30

    Expert Comment

    I believe so. Try it and see.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now