Original Sticker Address:
51580102
The specific methods are:
Create a Trigger
CREATE TRIGGER Forbiddensaon all SERVER with EXECUTE as'SA'For Logonasbegin--Select SA user to restrict: IF Original_login ()='SA'--allow SA to log on natively "" and (select EVENTDATA (). Value ('(/event_instance/clienthost) [1]','NVARCHAR ()')) not in ('<local machine>','127.0.0.1','10.24.15.15') ROLLBACK; END;
and view the link information for SQL Server
SELECT A.[session_id],a.[login_time],a.[host_name],a.[original_login_name],b.[client_net_address]from MASTER.sys.dm_exec_sessions a INNER JOIN MASTER.sys.dm_exec_connections b on a.session_id=b.session_id
Remove the syntax for this trigger
View two views of a trigger database-scoped DDL triggers with Sys.triggers server-scoped DDL triggers with sys.server_triggers
Explanation of the official website
# I haven't seen it yet #
HTTPS://msdn.microsoft.com/zh-cn/library/ms176054 (v=sql.100). aspx
Reprint SQL Server uses trigger implementations to disable SA users from non-native logons