From the course: Microsoft SQL Server 2016: Installation and Administration
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Logon triggers - SQL Server Tutorial
From the course: Microsoft SQL Server 2016: Installation and Administration
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…