By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

DTS package query

100+
P: 293
Hi All,

I want to execute two sql statement conditionally in a single SQLTask of the DTS package -

Is it possible to implement this ?

Please reply.

Thanks!
Feb 2 '10 #1
Share this Question
Share on Google+
4 Replies


Delerna
Expert 100+
P: 1,134
I guess it depends on the condition....but Yes
Feb 7 '10 #2

100+
P: 293
Hi Delerna,

Thank you for the reply.

I would like to know about it's implementation.

Could you please help me?

Thanks!
Feb 8 '10 #3

Delerna
Expert 100+
P: 1,134
Yes I can help but your question is too general

I get the "choose between two queries"...but based on what condition?


In DTS you can make a choice between two tasks based on
The success status of a third task.
The result of some VB code.
The content of a record in a table.
You can execute a stored proc passing parameters and let the stored proc make the choice
etc etc etc.



Also
Why must it be a single SQLTask?
If 3 or 4 tasks are necessary to achieve your desired result what does it matter?
Feb 8 '10 #4

Delerna
Expert 100+
P: 1,134
I guess to answer your question in generic tems then a simple generic example might suffice
one way is just like you would make a choice in any language.
Useing TSQL syntax, something like this
Expand|Select|Wrap|Line Numbers
  1.    IF condition
  2.    BEGIN
  3.       trueSQLQuery
  4.    END ELSE BEGIN
  5.       falseSQLQuery
  6.    END
  7.  
Feb 8 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.