Multiple values to store in multiple variables

  • Here my assumption in the result set is

    Resultset1+(DT_STR,12,1252)RecordNumber + Amount1 + Amount2 +

    Resultset2+Resultset3 .....

    in the above sequence order of the columns might changed in future when there is a requirement.

  • simhadriraju (2/7/2012)


    Here my assumption in the result set is

    Resultset1+(DT_STR,12,1252)RecordNumber + Amount1 + Amount2 +

    Resultset2+Resultset3 .....

    in the above sequence order of the columns might changed in future when there is a requirement.

    Then you'll need to adapt the package.

    This still doesn't explain why you can't concatenate the columns.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • As i said intially in my requirement i have hundreds of select queries which produces hundreds of result sets i want to store them in a variables so that if i need them sub taks i can make use of them.

    Here i am not interested to use hundereds of execute SQL task and read the variables . I require a solution in one task and multiple variables can store the multiple results.

  • if there are members from united states please give their phone number so that i can call and explain you clearly.

  • simhadriraju (2/7/2012)


    As i said intially in my requirement i have hundreds of select queries which produces hundreds of result sets i want to store them in a variables so that if i need them sub taks i can make use of them.

    Here i am not interested to use hundereds of execute SQL task and read the variables . I require a solution in one task and multiple variables can store the multiple results.

    Using SSIS there isn't one task that can do that for you.

    In TSQL neither.

    You cannot store all those resultsets in seperate variables without declaring them first.

    If you use .NET, you could store them in an array or matrix.

    But then again, you'll need hours of coding dynamic SQL to retrieve them, as every SELECT statement changes for every table.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • What is missing are concrete examples of what you are trying to accomplish. Please provide us with the ddl (CREATE TABLE statements) for the tables, sample data (as a series of INSERT INTO statements) for oeach table that is representative of your problem domain, and most importantly the expected results based on the sample data.

  • So finally i request what could be the ideal solution for this..

  • simhadriraju (2/7/2012)


    So finally i request what could be the ideal solution for this..

    Allright, two people now (Lynn and I) asked for DDL, sample data and desired output.

    As long as you do not provide them, I'm not wasting any more effort on this thread.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • simhadriraju (2/7/2012)


    So finally i request what could be the ideal solution for this..

    We can't help you if you don't help uis by providing us with the information we have requested. It is all up to you. Remember, we are volunteers giving of our own time to help. Also, we can't see what you see. Without the information we have requested all we can do is shoot in the dark and hope the answers we give help.

    Bottom line, help us help you.

  • I have a table with below set of columns

    Table Code_desc

    description

    code_type

    code

    i have the data like below

    Code_desc

    Description -- Code_type -- Code

    Order Types description ORDTYP ORDT

    Product Types description PRDTYP PRDT

    Customer Types description CustTYP CUDT

    ........................... ........................................

    Like above there are hundreds of codes

    in SSIS i have to read them as per below query

    select @orderdesc = description from code_desc where code_type='ORDTYP' and code='ORDT'

    select @Productdesc = description from code_desc where code_type='PRDTYP' and code='PRDT'

    ...........................................................

    I have another table XYZ (No relation with above table) with below columns

    ID

    Policy_number

    Expirydate

    IN SSIS i have to build abn expression like below.

    expression = @orderdesc + ID + Expirydate + @Productdesc

    and finally export to a flat file.

  • So the table Code_Desc and XYZ have no relation at all, but you still want to join them together? That seems a little odd.

    And first you said you had hundreds of tables, but now it is hundreds of codes inside a table?

    It still seems to me that you're stuck with hundreds of different SQL SELECT statements, especially if you do not know upfront which codes you need.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • So Please suggest me how can i acheive this complex task with a minimal

    workaround

  • simhadriraju (2/7/2012)


    So Please suggest me how can i acheive this complex task with a minimal

    workaround

    Did you notice the question marks in my previous reply? It means that I have asked a question...

    Did you also notice that the last sentence said that, according to the information you've given me, I see no minimal work around.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • ok finally solutions could be

    using hundreds .. of sql taks cannot we achieve this

    .NET script component

    Any alternates .................. ????????

  • simhadriraju (2/7/2012)


    ok finally solutions could be

    using hundreds .. of sql taks cannot we achieve this

    .NET script component

    Any alternates .................. ????????

    What did you expect? You ask for a solution that will extract hundreds of variables, each needing it's own SQL statement to retrieve it, and a concatenation of those variables in an apparently random order.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 15 posts - 16 through 30 (of 35 total)

You must be logged in to reply to this topic. Login to reply