Solved

DTS export to Access | Excel | CSV condition

Posted on 2004-08-17
7
310 Views
Last Modified: 2012-08-13
Just interested how the following can be handled?

One source, and destination speficied by global variable, i.e. Access, Excel or CSV.
Is the only way to accomplish this by disabling all Data Pump Tasks by default, and then depending on the global variable, enable for example only the data pump tasks for Access ?
0
Comment
Question by:Tacobell777
  • 3
  • 2
7 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 11827548
Conditional workflow should work as well:

http://techrepublic.com.com/5100-6329-5198879-2.html
0
 
LVL 17

Author Comment

by:Tacobell777
ID: 11847937
hmm, if I understand it correctly it would mean I needed 3 branches for a condition that could take 3 possible values, or more if it can have more than 3 values, correct?

For example;

If DTSGlobalVariables("exportTo").Value = "Access" Then
              Main = DTSTaskExecResult_Success
       Else

              Main = DTSTaskExecResult_Failure
       End if

Which really handles only Access if not true pass it on to the next branch which checks to see if we can match a value

If DTSGlobalVariables("exportTo").Value = "Excel" Then
              Main = DTSTaskExecResult_Success
       Else
              Main = DTSTaskExecResult_Failure
       End if

If DTSGlobalVariables("exportTo").Value = "CSV" Then
              Main = DTSTaskExecResult_Success
       Else
              Main = DTSTaskExecResult_Failure
       End if

Is this the idea?

Its workable, but not pretty...
0
 
LVL 17

Author Comment

by:Tacobell777
ID: 11848136
not sure how pretty this is either, I got it to work as per above, but it returns 2 tasks failed, while in reality they did not really fail...
0
 
LVL 34

Accepted Solution

by:
arbert earned 250 total points
ID: 11848691
Right, you need ELSE IF statements--you don't want to fail on the else statements....Something like this:

If DTSGlobalVariables("exportTo").Value = "Excel" Then
              Main = DTSTaskExecResult_Success
ElseIf DTSGlobalVariables("exportTo").Value = "CSV" Then
              Main = DTSTaskExecResult_Success
       Else
              Main = DTSTaskExecResult_Failure
End if


You're thinking above is correct though!

Brett
0
 
LVL 17

Author Comment

by:Tacobell777
ID: 12147465
Sjeesh sorry guys,

don't know how I missed this one..

Thanks Arbert for your help on this one...
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
2 Select Distinct 8 35
Syntax Error in Query 7 30
SQL Server Deadlocks 12 47
What is format f12.8 for a CSV file 6 37
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

929 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now