[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-04-17
4
Medium Priority
?
227 Views
Last Modified: 2013-11-10
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
0
Comment
Question by:ToddFields2
  • 3
4 Comments
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24172686
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
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24172689
Edit: of course, by manually I meant by manually adding a line of code to do it automatically...
0
 

Author Comment

by:ToddFields2
ID: 24172702
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
 
LVL 5

Accepted Solution

by:
brandonvmoore earned 1500 total points
ID: 24172728
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question