Use temp table in package

  • Hi all,

    Just curious, can I use a Execute SQL task to create a session temp table (#MyTable) and use that in my other data flow tasks in the same package? Or do I have to physically create the table in a database?

    Thanks,

    Strick

  • If you want to be able to use a temo table across sessions then you must create it a little differently. Now this is very tricky so I will try to explain it the best I can.

    when you create the temp talbe use the following

    creaate table ##tmptbl

    Sorry it is friday and my odd sens of humor is kicking in. Ok so that was not all that complex at all but here is the skinny of it

    A table created with a single pound will be closed when the session is closed and will not cross sessions. however if a double pound is used then you can use that across sessions and it will not close when the session closes.

    So here is the important part. With the double pound you must drop the table after you are done with it or it will still exist when you run the next time.

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.

  • [font="Comic Sans MS"]

    Why don't you click the first 2 result of the link below:

    :w00t: Answer :w00t:

    [/font]

    [font="Comic Sans MS"]--
    Sabya[/font]

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

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