Solved

Multiple OLE DB Queries With SSIS

Posted on 2010-09-10
5
1,744 Views
Last Modified: 2012-06-27
I have several queries written against a Teradata database (OLEDB connection) in SSIS. I am using MS SQL 2005. The queries save the results in a volatile table (temporary session  table).  An example of the query structure is listed in the code section.

When I place the queries into an a "execute SQL task", I get an error saying that only a single query can be processed.  However, when I place each query in a separate "execute SQL Task", the second query (third, fourth etc.) queries can't find the volatile table created by the earlier queries. Each SQL task created a new session.  In other words, each execute SQL task logged out after it was completed and can't find the volatile table created earlier.

Due to space constraints,  I can't save the results to a real table.  I was thinking that I could modify the SSIS package, to use one session for all of the "execute SQL tasks" .  How do I do this?  I wanted to please ask for your assistance to create one session  to run all of the queries- maybe there is an SSIS query container that would work.  
create volatile table tablename, no log
as(
select query 
) with data
on commit preserve rows;

create volatile table tablename2, no log
as(
select query 
From tablename1-- created from query above
) with data
on commit preserve rows;
(there are three more queries)

Open in new window

0
Comment
Question by:jjrr007
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 500 total points
ID: 33647992
In order to make use of the Temp tables in SSIS, you will need to change the property of the Execute SQL task Connection Manager

Click on Connection Manager --> Press F4 (properties)--> Change Retain Same Connection to TRUE

Never worked against TeraData Temp tables before..but,i guess you can give it a try
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33648000
Also set the Delay validation Property of the Task to TRUE
0
 
LVL 1

Author Comment

by:jjrr007
ID: 33650089
This worked.  You are good.
0
 
LVL 1

Author Closing Comment

by:jjrr007
ID: 33650095
Thanks for your time and expertise
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33650112
No problem Glad it helped..
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
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.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

820 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