Microsoft® SQL Server® 2012 Bible
887 Chapter 36: Creating Triggers 36 Because an INSERT affects all columns, the UPDATE() function returns true for any column yo ...
888 Part VII: Monitoring and Auditing CREATE FUNCTION dbo.GenColUpdated (@Col INT, @ColTotal INT) RETURNS INT AS BEGIN; -- Copyr ...
889 Chapter 36: Creating Triggers 36 The scope of the inserted and deleted t a b l e s i s l i m i t e d t o t h e t r i g g e r ...
890 Part VII: Monitoring and Auditing statement — a serious data integrity fl aw. They’ll even use cursors to step through each ...
891 Chapter 36: Creating Triggers 36 Analytics & Guessing '; Result: ------------------------------------------ Analytics &a ...
892 Part VII: Monitoring and Auditing ■ (^) Audit trail ■ Modifi ed date ■ (^) Complex security Nested Triggers Trigger nesting ...
893 Chapter 36: Creating Triggers 36 EXEC sp_configure 'Nested Triggers', 0; RECONFIGURE; SQL Server triggers have a limit of 32 ...
894 Part VII: Monitoring and Auditing A trigger is considered recursive only if it directly fi res itself. If the trigger execut ...
895 Chapter 36: Creating Triggers 36 Raiserror('Update failed.', 16, 1); ROLLBACK; Return; End; -- Update the Modified date UPDA ...
896 Part VII: Monitoring and Auditing Every trigger has the opportunity to ROLLBACK the transaction. If the transaction is rolle ...
897 Chapter 36: Creating Triggers 36 The AdventureWorks2012 database includes a simplifi ed inventory system. To demonstrate tra ...
898 Part VII: Monitoring and Auditing AS UPDATE Production.ProductInventory SET Quantity += i.Value FROM Production.ProductInven ...
899 Chapter 36: Creating Triggers 36 Result: ProductID Shelf Quantity LocationID 707 N/A 297 7 The Inventory Trigger The quantit ...
900 Part VII: Monitoring and Auditing To demonstrate the trigger, the following UPDATE attempts to change the quantity on hand f ...
901 Chapter 36: Creating Triggers 36 DDL Triggers DDL triggers are useful for auditing server-level and database changes. They c ...
902 Part VII: Monitoring and Auditing Using Management Studio, database triggers are listed under the database’s Programmability ...
903 Chapter 36: Creating Triggers 36 The third DDL trigger traps only create table commands: CREATE TRIGGER DDL_Create_Table_Sam ...
904 Part VII: Monitoring and Auditing ■ (^) Caller: Executes as the person executing the DDL command that fi res the DDL trigger ...
905 Chapter 36: Creating Triggers 36 and deleted virtual tables; DDL triggers have the EventData() function. This function retur ...
906 Part VII: Monitoring and Auditing Preventing Database Object Changes DDL triggers can execute code, including a transaction ...
«
42
43
44
45
46
47
48
49
50
51
»
Free download pdf