Reformat Group membership table
- From: reformat table <reformat table@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 2 Sep 2009 18:46:01 -0700
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
.
- Follow-Ups:
- Re: Reformat Group membership table
- From: Uri Dimant
- Re: Reformat Group membership table
- Prev by Date: Re: Selection by part of a field
- Next by Date: Re: Format SQL time type
- Previous by thread: Square characters in .sql file?
- Next by thread: Re: Reformat Group membership table
- Index(es):
Relevant Pages
|