SQL Server database Add role, role authorization

Source: Internet
Author: User
Sometimes we need to share data with third parties, but we don't have a completely open database.   Therefore, the use of database role authorization can be a good solution to this problem. The following are the SQL statements used in the work. Just take notes.

--Create role role_techdbexec sp_addrole ' role_techdb '--grant ROLE_TECHDB all permissions to Gxjg_jzgjcsjzlb,gxxx_yxsdwjbsjzl table Grant SELECT, Delete,insert,update on GXJG_JZGJCSJZLB to Role_techdbgrant select,delete,insert,update on GXXX_YXSDWJBSJZL to Role_ techdb--Add login zf_login, set password for [email protected], default database is Techdbexec sp_addlogin ' zf_login ', ' [email protected] ', ' techdb ' exec sp_grantdbaccess ' zf_login ', ' zf_login '--add zf_login for role ROLE_TECHDB member exec sp_addrolemember ' role_techdb ', ' zf_ Login

SQL Server database Add role, role authorization

Related Article

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.