From the course: Microsoft SQL Server 2016: Installation and Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Logon triggers

Logon triggers - SQL Server Tutorial

From the course: Microsoft SQL Server 2016: Installation and Administration

Start my 1-month free trial

Logon triggers

- [Instructor] In this video, we'll focus on logon triggers and their uses in SQL Server 2016. Now, essentially, logon triggers will cause a stored procedure to execute in response to a logon event. And, of course, a logon event is raised when a user session gets established with a specific instance of SQL Server. And the event that we are working with will fire after the authentication phase but prior to the session being established. So it's very important to understand why it works in that fashion. So we authenticate the user and then we verify that the user is actually authenticated or allowed to perform the action that they want to do. If so, then the session gets established. However, if authentication fails, then the trigger's not going to fire. And that makes sense because if the user is not authorized to perform the action, then we don't want to allow them to perform the action at all. So the trigger won't fire and their authentication fails and they're not allowed to do…

Contents