Solved

Multiple OLE DB Queries With SSIS

Posted on 2010-09-10
5
1,816 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

617 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