-----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