Answered Select value from a table

  • Wednesday, July 18, 2012 2:45 PM
     
     

    Hello,

    I need to select a value from a table at the beginning of my SSIS package. Depending on whether the value is 0 or 2, will dictate which direction my package will go in. I am not sure how to do this. Any help would be appreciated.

    Dave


    Dave SQL Developer

All Replies

  • Wednesday, July 18, 2012 3:18 PM
     
     Answered

    use SQL task as source to get the desired info from sql db. then store the value in a variable. then check the value of that variable(using script task or whatever) and go ahead with your logic.

    sql task to read data from db : http://www.sqlis.com/post/The-Execute-SQL-Task.aspx

    script task(read variable) :http://www.programmersedge.com/?p=1350

    regards

    joon

    • Marked As Answer by DaveDB Wednesday, July 18, 2012 3:38 PM
    •  
  • Wednesday, July 18, 2012 3:30 PM
     
     

    This does not tell me how to store the value in a variable. This just explains the Execute SQL Task. Essentially, this is what I would like to do...

    1) Create SSIS Variable called @Return (done)

    2) Then do something like this....

    set @return = Select top 1 from table

    3) Then, depending on the value in the variable, this will dictate the direction of the tasks.


    Dave SQL Developer

    • Marked As Answer by DaveDB Wednesday, July 18, 2012 3:38 PM
    • Unmarked As Answer by DaveDB Wednesday, July 18, 2012 3:38 PM
    •  
  • Wednesday, July 18, 2012 3:38 PM
     
     
    My bad, I had to read on :)

    Dave SQL Developer