Which SQL Server entity should you use?

You are the database administrator of your company. You create a logon trigger on a SQL Server 2008 computer.
The trigger will be used to deny login attempts to the server that are initiated by a login named Admin_login ifthere are already two existing sessions for that login.
You want to view the metadata for the logon trigger youcreated. Which SQL Server entity should you use?

You are the database administrator of your company. You create a logon trigger on a SQL Server 2008 computer.
The trigger will be used to deny login attempts to the server that are initiated by a login named Admin_login ifthere are already two existing sessions for that login.
You want to view the metadata for the logon trigger youcreated. Which SQL Server entity should you use?

A.
the sys.trigger_events catalog view

B.
the sp_helptrigger system stored procedure

C.
the sys.server_triggers catalog view

D.
the sp_monitor system stored procedure

Explanation:

You should use the sys.server_triggers catalog view. Logon triggers are used to fire stored procedures when aLOGON event occurs. A LOGON event occurs when a user establishes a session with a SQL Server instance.Logon triggers fire after the authentication for the login process has finished, but before the user session isestablished. Logon triggers do not fire if authentication fails. You can use logon triggers for auditing andcontrolling server sessions, restricting logins to a SQL server during a specified time, or limiting the number ofsessions for a particular login. You can use the CREATE TRIGGER Transact-SQL statement to create logontriggers. The metadata for logon triggers can be viewed by querying the sys.server_triggers catalog view. The sys.server_triggers catalog view contains information about all server-level Data Definition Language (DDL)triggers that have an object type of assembly trigger or SQL trigger. You should not use the sys.trigger_events catalog view because it does not contain metadata for logon triggers.In addition, you should not use the sp_helptrigger or sp_monitor system stored procedure because neither ofthese stored procedures retrieve metadata for logon triggers. The sys.trigger_events catalog view containsinformation about each event for which a trigger fires. The sp_helptrigger system stored procedure providesinformation on the type or types of DML triggers that are defined on a specified table for the database in use. The sp_monitor system stored procedure shows statistics for SQL Server.

Objective:
Managing SQL Server Security

Sub-Objective:

Manage SQL Server instance permissions.

References:
TechNet > TechNet Library > Server Products and Technologies > SQL Server > SQL Server 2008 > ProductDocumentation > SQL Server 2008 Books Online > Database Engine > Operations > Administration > LogonTriggers



Leave a Reply 0

Your email address will not be published. Required fields are marked *