SQL Server Permissions

Source: Internet
Author: User

-----whether there is a valid login account: Whether it is disabled, SQL login also: whether the password is expired, is locked

Select
is_disabled, LoginProperty (name, ' isexpired ') is_expired, LoginProperty (name, ' Islocked ') is_locked,* from Sys.server_ Principals
where name = ' Sys_copy '

Principal type:
S = SQL Login Name
U = Windows Logon name
G = Windows Group
R = Server Role
C = logon name mapped to the certificate
K = login Mapped to an asymmetric key

------in SQL Server, use the system's stored procedures to manage logins, mainly including:

sp_addlogin sp_droplogin Sp_helplogins

sp_grantlogin sp_revokelogin sp_denylogin

It is important to note that the stored procedures for these systems must be used in the master database.

--agent Service Permissions

ALTER ROLE [SQLAgentUserRole] ADD MEMBER [test]
GO

---grant permissions

Use ADVENTUREWORKS2008R2; GRANT UPDATE on person.address to person; GO---Grant the user the Insert permission to the table person.address use ADVENTUREWORKS2008R2; GRANT INSERT on person.address to person; GO---Grant the user person the Delete permission on the table person.address use ADVENTUREWORKS2008R2; GRANT DELETE on person.address to person;


--Grant execute permission to user stored procedure Dbo.prc_errorlog
GRANT EXECUTE on Dbo.prc_errorlog to Person

Scalar function permissions: EXECUTE, REFERENCES.

Table-Valued Function permissions: DELETE, INSERT, REFERENCES, SELECT, UPDATE.

Stored procedure permissions: EXECUTE.

Table permissions: DELETE, INSERT, REFERENCES, SELECT, UPDATE.

View permissions: DELETE, INSERT, REFERENCES, SELECT, UPDATE.

SQL Server Permissions

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.