在sql server中创建角色 [英] create roles in sql server

查看:174
本文介绍了在sql server中创建角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

i必须根据用户设计角色数据库结构



请指导我如何设计意味着放置什么属性在



提前感谢

hi all
i have to design database structure for roles according to users

please guide me how to design means what attributes to put in

thanks in advance

推荐答案





简单地说,你可以这样做。

创建角色主表,如下所示。



角色主表

代码

描述

1

经理

2

职员

3

导演





,代码为主键。



然后创建如下的User表。



用户表

ID

名称

角色

1

姓名1

1

2

Name2

2

3

Name3

3





,其中Role列引用Role Master Table中的Code列。并且您可以插入示例中显示的示例数据。这是最简单的方法。



希望它有所帮助。
Hi,

In a simple way you can do like below.
Create the Role Master Table like below.

Role Master Table
Code
Description
1
Manager
2
Clerk
3
Director


with code as primary key.

Then create the User table like below.

User Table
ID
Name
Role
1
Name1
1
2
Name2
2
3
Name3
3


with Role column referencing the Code column in Role Master Table. and you can insert the data as the sample show in the example. this is a simplest way.

hope it helps.


我按照以下链接最佳答案欢呼



http: //college.yukondude.com/2003_01_comp220/html/note-container.php?file=04^Design_Pattern^Role-Based_Security.html [ ^ ]
i follow below link best answer cheers

http://college.yukondude.com/2003_01_comp220/html/note-container.php?file=04^Design_Pattern^Role-Based_Security.html[^]


http://msdn.microsoft.com/en-us/library/ms187936.aspx [ ^ ]



http://www.techrepublic.com /条/理解,ROL es-in-sql-server-security / 1061781 [ ^ ]


这篇关于在sql server中创建角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆