sp_logintrigger

Description

Sets and displays the global login trigger. This global login trigger has the same characteristics as a personal login script. It is executed before any personal login script for every user that tries to log in, including system administrators and security officers.

Syntax

sp_logintrigger 'global login trigger name'

Parameters

global login trigger name

is the name of the global login trigger.

If you include no parameter, sp_logintrigger displays the current login trigger status and name if it exists, and no rows if there is no global login trigger defined.

Examples

Example 1

Sets a global login trigger using sp_logintrigger:

sp_logintrigger 'master.dbo.myproc'

Example 2

Returns an updated global login trigger:

1> sp_logintrigger
2> go
Global login trigger               Status
---------------------------------- -------
sybsystemprocs.dbo.myproc          Enabled
(1 row affected)
(return status = 0

Example 3

When a global login trigger does not exist:

1> sp_logintrigger
2> go
Global login trigger Status
-------------------- ------
(0 rows affected)

Example 4

Deletes a global login trigger specified earlier with sp_logintrigger:

sp_logintrigger 'drop' 

Usage

Permissions

The permission checks for sp_logintrigger differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be a user with manage security configuration privilege to set a new login trigger.

Any user can execute sp_logintrigger to display the current global login trigger.

Granular permissions disabled

With granular permissions disabled, you must be a user with sso_role to set a new login trigger.

Any user can execute sp_logintrigger to display the current global login trigger.