Solved

DTS export to Access | Excel | CSV condition

Posted on 2004-08-17
7
311 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert in derived column 7 30
TSQL - How to declare table name 26 31
SQL SELECT query help 7 41
create an aggregate function 9 36
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
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.
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.

810 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