SQL Server DBA Tutorial 91-How to Create Server Level Trigger in SQL Server

preview_player
Показать описание
In this video tutorial you will learn how to create SQL Server Level Trigger in SQL Server using T-SQL script. Script will teach you how to create Server Level Trigger, how to store trigger output in a table, how to send email based on different events occurred on SQL Server instance such as creating database, dropping database etc. It also illustrates how to use DBMail in SQL Server to send alerts to your email.

Blog post link for this video:

Visit our website to check out SQL Server DBA Tutorial Step by Step
Рекомендации по теме
Комментарии
Автор

only if you could show things in details, such as PermissionAudit Table that how it was created and how many columns it has that would be big help.

sakijilan
Автор

Cannot insert the value NULL into column 'DatabaseUser', table 'master.dbo.PermissionAudit'; column does not allow nulls. INSERT fails. The statement has been terminated. (Microsoft SQL Server, Error: 515)..plz help

joshuaprakash
Автор

Could you please share the LINK from where you get all the sql scripts for Tutorials.

prakashsingh
Автор

Thank you for your dedication and excellent explanation. However, I am a bit confused creating the “AuditPermission” table. What datatype have you used? Because after executing your scrips successfully a Trigger has been created but the table has not been created yet in master database. I assume, because of that I am getting an error message when I am trying to create a database. Did I miss any video where you showed how you created that table? Below is the error message I am getting. Thank you!

“Msg 257, Level 16, State 3, Procedure dbcreate, Line 11 [Batch Start Line 9]
Implicit conversion from data type xml to nvarchar(max) is not allowed. Use the CONVERT function to run this query”

antem.
Автор

where should we create a permission audit table and how?

joshuaprakash
Автор

After running your script, when i tried to create new database it's said invalid object name master.dbo.permisiionaudit error please help me.

mallipudisairam