SQL Query Help....

  • We get data in this format from a different dept. and I need help with SQL query so that the data can be stored in a readable format.

    create table #GrpTable

    (

    GroupNames varchar(100),

    AccessType varchar(100)

    )

    insert #GrpTable

    select 'ACCOUNTING, REPORTS, MARKETING, ADMIN, OFFICE,', 'Read Modify Modify Read NoAccess'

    The output should be:

    GroupNamesAccessType

    ACCOUNTINGRead

    REPORTSModify

    MARKETINGModify

    ADMINRead

    OFFICENoAccess

    Thanks !

  • Try the code from this article: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks, I got it using the DelimitedSplit8K function.

Viewing 3 posts - 1 through 2 (of 2 total)

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