locked
store the select query result as variable and load on another table in ssis RRS feed

  • Question

  • Hi guys ...

     Like to know how i can store select query result in variable and then  load it to the other table in SSIS-2005.

    i am using select count (*) from dbo.my_Table on Server1. want to store this query result in variable and then load this result on Server2\MY_db.dbo.xyz.

    Thanks for help


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

    Friday, April 19, 2013 8:06 PM

Answers

  • Create an integer variable in the scope of the package and then use an execute sql task to store the query result in the variable. 

    Now you can use the same integer variable to load to xyz table on Server2. 


    Nitesh Rai- Please mark the post as answered if it answers your question

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Friday, April 19, 2013 10:51 PM
  • Hi,

    step 1:

    Create a variable in package scope of type INT

    step 2:

    Drag n drop 2 Execute SQL task on Control Flow tab

    then follow as shown in screen shots:

    Note: Dont forget to provide respective server details in Connection option of Execute SQL task.


    sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Saturday, April 20, 2013 4:39 AM

  • sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Saturday, April 20, 2013 4:41 AM

  • sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 11:33 AM
    Saturday, April 20, 2013 4:43 AM

All replies

  • Create an integer variable in the scope of the package and then use an execute sql task to store the query result in the variable. 

    Now you can use the same integer variable to load to xyz table on Server2. 


    Nitesh Rai- Please mark the post as answered if it answers your question

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Friday, April 19, 2013 10:51 PM
  • Hi Nitesh . 

     if u can explain me in details with example would be great help like u did on my last post would be great help.

    THanks


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

    Saturday, April 20, 2013 2:17 AM
  • Hi,

    step 1:

    Create a variable in package scope of type INT

    step 2:

    Drag n drop 2 Execute SQL task on Control Flow tab

    then follow as shown in screen shots:

    Note: Dont forget to provide respective server details in Connection option of Execute SQL task.


    sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Saturday, April 20, 2013 4:39 AM

  • sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 12:35 PM
    Saturday, April 20, 2013 4:41 AM

  • sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

    • Marked as answer by -kit Monday, April 22, 2013 11:33 AM
    Saturday, April 20, 2013 4:43 AM