To add the column Dynamically

  • Dear Experts,

    I Struggled in comma seprator values into column,

    I have a one column name AUTHOR the value

    AUTHOR

    Sara1,sara2,sara3,sara4

    But

    I want to retrive the data like

    author1author2author3AUTHOR4

    Sara1sara2sara3sara4

    But the Author column is unstable,

    Some time it will have 5 comma seprator values or 2 or 7

    But i need to create the result set as dynamicall at runtime,

    Note: If its fixed i can , but dynamics is my problem

    Thanks in advance,

  • I'm sure this will help:

    http://www.sqlservercentral.com/articles/T-SQL/62867/

    -- Gianluca Sartori

  • CELKO (11/29/2010)


    Why don't you normalize your data instead? That would probably give you tables for Authors (entity), Books (entity), and Authorship (relationship between authors and their books).

    Excellent point.

    100% agreed.

    -- Gianluca Sartori

  • Yes, you are correct, But our software end user's, they said clearly, will not fill up the values in multiple text box, they need single input box only like comma seprtor ,it can be reiterated n time..., that is the reason...... am

    analyzing

  • I'm sure you know that this is a presentation issue, not related to how you store your data.

    You can fill a text box with comma separated values, then split on the app side and persist to a properly designed database.

    -- Gianluca Sartori

Viewing 5 posts - 1 through 4 (of 4 total)

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