sql指令碼建立使用者角色許可權表

來源:互聯網
上載者:User

標籤:database   primary   使用者表   管理員   null   desc   arc   管理   bsp   

 1 /******************************************/ 2 /*         名稱:許可權管理                  */ 3 /*         編寫日期:2010.5.20            */ 4 /*         開發人員:dangqinghua             */  5 /*****************************************/ 6 --Create database Grop 7 --go 8 use Grop 9 go10 -----建立使用者表11 Create table Users12 (13     U_ID int identity(1,1) primary key,14     Uname varchar(50) not null, 15 )16 go17 ----建立角色表18 Create table Roles19 (20     Role_ID int identity(1,1) primary key,21     Role_Name varchar(100) not null,22     Rloe_Description varchar(400) null,   /*角色備忘*/23 )24 go25 ----建立許可權表26 Create table Fun27 (28    Fun_ID int identity(1,1) primary key, 29    Fun_Name varchar(50)not null, 30 )31 go32 ---建立使用者角色表33 Create table UsersRole34 (35    Users_Role int identity(1,1) primary key,36    U_ID int foreign key references Users(U_ID),37    Role_ID int foreign key references Roles(Role_ID),38 )39 go40 ----建立角色許可權表41 Create table FunRole42 (43    FunRole_ID int identity(1,1) primary key,44    Fun_ID int foreign key references Fun(Fun_ID), 45    Role_ID int foreign key references Roles(Role_ID),   46 )47 go48 insert into Users values(‘111‘)49 insert into Users values(‘張三‘)50 insert into Users values(‘李四‘)51 insert into UsersRole values(1,1)52 insert into UsersRole values(2,1)53 insert into Roles values(‘系統使用者‘,‘欄目管理‘)54 insert into Roles values(‘管理員‘,‘管理後台‘)55 insert into Roles values(‘超級管理‘,‘所以許可權‘)56 insert into FunRole values(1,1)57 insert into FunRole values(2,2)58 insert into Fun values(‘新增‘)59 insert into Fun values(‘編輯‘)60 insert into FunRole values(1,1)61 insert into FunRole values(1,2)62 select * from Roles63 select * from UsersRole64 select * from users65 select * from fun66 select * from funRole67 收藏於 2010-07-14

 

sql指令碼建立使用者角色許可權表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.