Data Conversion Issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Info

    Data Conversion Issue

    Hi,

    I have a simple query that does the following :-


    select desc1,desc2,des c3,desc4,desc5 from testdata


    So I select the data for the above

    What I would like to achieve without having to go to great lengths the
    following:-


    So taking the column desc1 I want to insert this into a table

    e.g.

    Desc1 is record 1 in the table
    Desc2 is record 2 in the table
    Desc3 is record 3 in the table
    Desc4 is record 4 in the table
    and so on

    Is there a tool or a special type declaration that can be used ?

    Regards
    Andrew

  • Erland Sommarskog

    #2
    Re: Data Conversion Issue

    [posted and mailed, please reply in news]

    Info (info@schnof.co .uk) writes:[color=blue]
    > I have a simple query that does the following :-
    >
    > select desc1,desc2,des c3,desc4,desc5 from testdata
    >
    >
    > So I select the data for the above
    >
    > What I would like to achieve without having to go to great lengths the
    > following:-
    >
    > So taking the column desc1 I want to insert this into a table
    >
    > e.g.
    >
    > Desc1 is record 1 in the table
    > Desc2 is record 2 in the table
    > Desc3 is record 3 in the table
    > Desc4 is record 4 in the table
    > and so on[/color]

    I'm afraid that I don't really understand what you are asking for. Could
    you provide the following:

    o CREATE TABLE statement for your table(s).
    o INSERT statement with sample data.
    o The desired result from this sample data.

    The reason I ask for this is that it clarifies your question, and with
    the script it's possible to post a tested solution.

    --
    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

    Books Online for SQL Server SP3 at
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    Working...