temp table

  • Hi,

    i want to check for the existience of a temporary table because i need to drop it in that case.

    i tried

    use tempdb

    Select name From sysobjects Where name = 'tablename'

    but it won't work because the table name is followed by underscores, like '#test________ ...' .

    so is there another way to do this as i don't want to build a workaround for the name?

    greetings

    jan

  • Hi,

    if (select object_id('tempdb.dbo.#test'))

    is not null

    print 'test'

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

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