DTS package query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madankarmukta
    Contributor
    • Apr 2008
    • 308

    DTS package query

    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!
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    I guess it depends on the condition....bu t Yes

    Comment

    • madankarmukta
      Contributor
      • Apr 2008
      • 308

      #3
      Hi Delerna,

      Thank you for the reply.

      I would like to know about it's implementation.

      Could you please help me?

      Thanks!

      Comment

      • Delerna
        Recognized Expert Top Contributor
        • Jan 2008
        • 1134

        #4
        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?

        Comment

        • Delerna
          Recognized Expert Top Contributor
          • Jan 2008
          • 1134

          #5
          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
          [code=sql]
          IF condition
          BEGIN
          trueSQLQuery
          END ELSE BEGIN
          falseSQLQuery
          END
          [/code]

          Comment

          Working...