Reformat Group membership table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Environment is SQL 2000 SP4

I have a 3rd party application which exports ActiveDirectory group
membership to a SQL table. Each day the export process creates a table with
the current date listed in the table name. The table is formatted as shown
below with two columns:

Group1 User1%CR%User2%CR%User3
Group2 User4%CR%User5
Group3 User6%CR%User7%CR%User8

*I've inserted '%CR% where there is a carriage return.

The table has the group name in one column and the users names in the second
column separated by carriage return.

I would like to run SQL queries that returns a result set which has all the
users of a group... with each user on in a separate row. The only way I
believe I can do this effectively is to reformat the table to a format
something like the table shown below:

Group1 User1
Group1 User2
Group1 User3
Group2 User4
Group2 User5
Group3 User6
.....

Then do some query like:
Select * From groupTable Where Group='Group2'

Results:
Group2 User4
Group3 User5

I'm looking for suggestions on how I can accomplish my SQL query... whether
it's by reformatting the table and then running a query to determine the
group membership or maybe someone has a super secret query that will get the
information I'm looking for. The other key to this is that I need a solution
that is easy to implment since this group export occurs every day.

Your help is appreciated!
Brian
.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: Populating a list -- table structure?
    ... I had made a report already and figured out about adding the ... your responce below, but thanks to your help with SQL, I was able to get the ... It takes a summary from a select query and gives the ... KitID, long integer ...
    (microsoft.public.access.forms)
  • How do I do Paging through a large dataset via Stored Procedures
    ... Paging by dynamically altering the SQL Query ... Create stored procedures ... SELECT * FROM STUDENTS ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Populating a list -- learning Access
    ... It is kinda funny -- I started using databases in the early 80's with dBase and, for years, never knew that I knew SQL! ... If you are on a form or report, the most important property is the NAME, because that is how you refer to it in code. ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)
  • Re: Populating a list -- table structure?
    ... I don't mean to skip your responce below, but thanks to your help with SQL, I was able to get the query to pull the info the way I needed. ... I have one report complete, ... Queries (just shows the QBE grid for convenience -- ...
    (microsoft.public.access.forms)