Droping temp table

  • Hello all,

    I have to drop one temp table (#tmptbl) in SP, with if exists.

    That means if that temp table exists, drop else create...i require syntax for this..

    Please help..

    __Jus

    -----------------------------------------------------------------------
    For better assistance in answering your questions[/url]
    Perforamance Issues[/url]
    Cross Tabs and Pivots[/url]
    Cross Apply[/url]
    The Numbers or Tally Table- Jeff Moden[/url]

  • IF OBJECT_ID('tempdb..#Table') IS NOT NULL

    DROP #Table

    _____________
    Code for TallyGenerator

  • Thanks a lot sergiy...it works..

    -----------------------------------------------------------------------
    For better assistance in answering your questions[/url]
    Perforamance Issues[/url]
    Cross Tabs and Pivots[/url]
    Cross Apply[/url]
    The Numbers or Tally Table- Jeff Moden[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply