Showing posts with label active. Show all posts
Showing posts with label active. Show all posts

Wednesday, March 28, 2012

Mapping Active Directory Group members to SQL Server Roles

My question is I have a SQL Server running on Web Server which is a member of a 2000 Active Directory, I only grant access to the database via Global Groups from the Active Directory. When I log onto the database via Windows Authentication the actual user shows up in the master.dbo.sysprocesses table, I can tell what database that process is going to but not how that user is being translated to the Global Group that was actually given access. I need the actual database user name which is the Global Group name that had permissions granted via user defined database roles so that I can do some pre-processing in an ASP.NET application so that I know what parts of a form are updatable or not.No, a Server Role container for users with a specific set of permission. The group has to be mapped to a principal in SQL Server to be included in a role.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.desql

Friday, March 23, 2012

many to many relationship - whats best way to add/edit/delete

I have a many to many relationship

I can design the table 2 ways:

1) Category table (cat_id, cat_name, active) - cat_id as PK
CategoryReq (cat_id, req_name) - cat_id & req_name as PK

2)
CategoryReq (req_name, cat_name) - req_name & cat_name as PK

IfI design 1st way. Then when they want to add and delete from theCategoryRequest table, they would have to add to the category tablefirst. Then maybe build a list of checkboxes to select from. The one'sthey check insert into the CategoryRequest table.

Drawback ofthis is that they can't edit the list on the fly. Since it may be usedby other request (since cat_id CategoryReq is fk into Category table)

If I design it the 2nd way. Then they can edit, delete, add on the fly. But there won't be a master category list.

Which way is better?

Hi,

The design of the database strictly derives from the application requirements. But as a rule of thumb, you should generally create normalized tables to the third normal form in RDBMS theory. And then denormalize only if necessary. (Usually, the main reason for denormalization is performance improvement). Denormalization can be very harmful. Do it sparingly and only if you know what are you doing!