Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to create a meta-data query

Author  Topic 

danielhai
Yak Posting Veteran

50 Posts

Posted - 2002-05-17 : 16:17:47

I'm not exactly sure if this is called "Meta Data", but I think it is. Here is what I'm trying to do. I have 2 tables, Area, and AreaRight.

Area is simple, looks like this:

AreaID AreaName
------ --------
1 Admin
2 Accounting
3 AnotherArea

AreaRight is simple as well:

RightID AreaID RightName
------- ------ ---------
1 1 Read
2 1 Write
3 1 Modify


I was wondering how to return a recordset that looks like this:

AreaID RightRead RightWrite RightModify
------ --------- ---------- -----------
1 1 2 3


Basically it'll return a subset as actual columns in another recordset. I know how to make it like that if I know exactly how many columns are coming back, but there could be any amount of rights per area. Eventually, this will hook up to a userrights table where the rights columns will return 0 and 1, depending on if they have rights or not.

Thanks for your help.


robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-17 : 16:23:18
SQL Team's Miracle Cross-Tab Elixir should fix your ills:

http://www.sqlteam.com/item.asp?ItemID=2955

Go to Top of Page
   

- Advertisement -