How to set permissions for database, table, and stored procedures at deploy time

Source: Internet
Author: User

Create a user Access database.
1  Use [Master]2 GO3 4 IF EXISTS(SELECT *  fromSys.server_principalsWHEREName= 'Wfpapp') 5     DROPLOGIN[Wfpapp]6 GO7 8 CREATELOGIN[Wfpapp]  withPASSWORD='[email protected]', Default_database=[WFP], check_expiration=OFF, Check_policy=OFF9 GOTen  One DENY VIEW  any DATABASE  to [Wfpapp];  A GO -   -  Use [WFP] the GO -  - IF EXISTS(SELECTName fromSys.sysusersWHEREName= 'Wfpapp') -     DROP User [Wfpapp]  + GO -  + CREATE USER [Wfpapp]  fromLOGIN[Wfpapp] A GO at  -  Use [Master] - GO -  - ALTER AUTHORIZATION  on DATABASE::[WFP]  to [Wfpapp] - GO in  -  to IF EXISTS(SELECT *  fromSys.server_principalsWHEREName= 'Wfpetl')  +     DROPLOGIN[Wfpetl] - GO the  * CREATELOGIN[Wfpetl]  withPASSWORD='[email protected]', Default_database=[WFP], check_expiration=OFF, Check_policy=OFF $ GOPanax Notoginseng  - DENY VIEW  any DATABASE  to [Wfpetl];  the GO +   A  Use [WFP] the GO +  - IF EXISTS(SELECTName fromSys.sysusersWHEREName= 'Wfpetl') $     DROP User [Wfpetl]  $ GO -  - CREATE USER [Wfpetl]  fromLOGIN[Wfpetl] the GO - Wuyi  Use [Master] the GO -  Wu ALTER AUTHORIZATION  on DATABASE::[WFP]  to [Wfpetl] - GO
View CodeSet permissions for created users, table stored procedures, views, and other permissions that can be manipulated
1  Use [WFP]2 GO3 GRANT EXECUTE  onDbo. P_activity_i to [Wfpapp]4 GRANT EXECUTE  onDbo. P_ic_roles_get_roles_for_user to [Wfpadminapp]     5 GRANT EXECUTE  onDbo. P_activity_member_access_reprot to [Wfpapp]6 7 8 GRANT EXECUTE  onDbo. F_ic_check_user_name to [Wfpapp]    9 GRANT EXECUTE  onDbo. f_ic_code_get_code_by_id to [Wfpapp]    Ten GRANT EXECUTE  onDbo. F_ic_code_get_id_by_code_codecategory to [Wfpapp]     One  A  - --Grant access to tables - GRANT SELECT,INSERT,UPDATE     on [dbo].[t_etl_job_execution]  to  [Wfpapp]   the GRANT SELECT,INSERT,UPDATE     on [dbo].[t_report_frequency]  to  [Wfpapp]   - GRANT SELECT,INSERT,UPDATE     on [dbo].[T_etl_job_status]  to  [Wfpapp]   - GRANT SELECT,INSERT,UPDATE     on [dbo].[t_ic_roles_actions]  to  [Wfpapp]   -  +  -  + --Grant access to View A GRANT SELECT      onDbo. V_check_consolidated_payment to  [Wfpapp]     at GRANT SELECT      onDbo. V_check_medisave_payable to  [Wfpapp]     - GRANT SELECT      onDbo. V_check_payment to  [Wfpapp]     - GRANT SELECT      onDbo. V_check_payment_detail to  [Wfpapp]     - GRANT SELECT      onDbo. V_check_payment_detail_update to  [Wfpapp]    
View Code

How to set permissions for database, table, and stored procedures at deploy time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.