Solved

DTS export to Access | Excel | CSV condition

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

Independent Software Vendors: 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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

695 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