How can you use a #temp table from one SSIS task in another task step?

Hi,

I'd like to create a #Temp table as part of join in a SQL statement in a OLE DB Source task step.  I keep getting an error as the # temp is not available at the time I build the new SQL OLE DB Source.  

I've tried ## temp tables and had no luck setting a SQL Task to use Full Result Set.

Any thoughts?

Thanks,
Todd
ToddFields2Asked:
Who is Participating?
 
brandonvmooreConnect With a Mentor Commented:
Yeah, the point (one of them anyway) of temporary tables is that they automatically get deleted, so if you need it to persist then that's what you'll need to do.  If you just didn't want to add it to the database your working with you could always create a seperate db for it though.  Sometimes I do that for miscellaneous tables instead of using temp tables anyway just so that I can access them through the ide.
0
 
brandonvmooreCommented:
Global temporary tables are deleted when all users referencing the table disconnect from Microsoft SQL Server.  I'm not sure if this is your problem or not.  Why not try using a regular table and deleting it manually?
0
 
brandonvmooreCommented:
Edit: of course, by manually I meant by manually adding a line of code to do it automatically...
0
 
ToddFields2Author Commented:
Hi,

Yeah, that is my option.  The issue would be that the table has to continue to exist (ie. I would truncate it and not drop it) so that the next OLE DB SQL would correctly compile.

Todd
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.