Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    36

    Smile Unanswered: Drop #Temporary Table

    I created the #Temporary table in MS SQL. Now i want to drop this #Temporary table, but i want to check first before i drop the this table. How to check the Temporary table exist or not in MS SQL?

  2. #2
    Join Date
    Jul 2004
    Posts
    52

    Checking to see if a temporary table exists

    IF Object_ID('tempdb..#mytable') Is NOT NULL
    DROP #mytable

  3. #3
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    This one will actually work. (grin)

    IF OBJECT_ID('tempdb..#mytable') IS NOT NULL
    DROP TABLE #mytable
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  4. #4
    Join Date
    Jul 2004
    Posts
    52
    DOH! (Who says intelligent posts can't be less than 10 characters?)

  5. #5
    Join Date
    Mar 2004
    Posts
    36
    I Test on it already, it really work, thankx! Every body

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •