14 lines
311 B
SQL
14 lines
311 B
SQL
CREATE TRIGGER E_LOGON_LIMIT_SA
|
|
ON ALL SERVER
|
|
FOR LOGON
|
|
AS
|
|
BEGIN
|
|
IF EXISTS(SELECT 1
|
|
FROM sys.dm_exec_sessions
|
|
WHERE is_user_process = 1
|
|
AND ORIGINAL_LOGIN()= 'sa'
|
|
AND original_login_name = 'sa'
|
|
HAVING COUNT(*) > 1)
|
|
ROLLBACK;
|
|
END;
|