Solved

DTS export to Access | Excel | CSV condition

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

759 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

20 Experts available now in Live!

Get 1:1 Help Now