Database reference - AdventureWorks

AdventureWorks -  triggers

DDL Triggers

namecreatedmodifiedparentcomment
safetyJul 17 2006 8:22PMJul 17 2006 8:22PMDATABASEkeep us safe! 
ddlDatabaseTriggerLogOct 14 2005 1:58AMOct 14 2005 2:00AMDATABASEDatabase trigger to audit all of the DDL changes made to the AdventureWorks database. 
ddl_trig_loginSERVER 

DML Triggers

namecreatedmodifiedtypeparentcomment
[dbo].[uAWBuildVersion]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [dbo].[AWBuildVersion]AFTER UPDATE trigger setting the ModifiedDate column in the AWBuildVersion table to the current date. Triggers come and go, but this one is one of the best. yea right. 
[dbo].[ClrTriggerTest]Nov 19 2006 1:23PMNov 19 2006 1:23PMAfter Update   [dbo].[ErrorLog]This is a CLR trigger. 
[HumanResources].[uDepartment]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[Department]AFTER UPDATE trigger setting the ModifiedDate column in the Department table to the current date. 
[HumanResources].[dEmployee]Oct 14 2005 1:59AMOct 14 2005 1:59AMInstead of Delete   [HumanResources].[Employee]INSTEAD OF DELETE trigger which keeps Employees from being deleted. 
[HumanResources].[uEmployee]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[Employee]AFTER UPDATE trigger setting the ModifiedDate column in the Employee table to the current date. 
[HumanResources].[uEmployeeAddress]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[EmployeeAddress]AFTER UPDATE trigger setting the ModifiedDate column in the EmployeeAddress table to the current date. 
[HumanResources].[uEmployeeDepartmentHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[EmployeeDepartmentHistory]AFTER UPDATE trigger setting the ModifiedDate column in the EmployeeDepartmentHistory table to the current date. 
[HumanResources].[uEmployeePayHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[EmployeePayHistory]AFTER UPDATE trigger setting the ModifiedDate column in the EmployeePayHistory table to the current date. 
[HumanResources].[uJobCandidate]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[JobCandidate]AFTER UPDATE trigger setting the ModifiedDate column in the JobCandidat table to the current date. 
[HumanResources].[uShift]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [HumanResources].[Shift]AFTER UPDATE trigger setting the ModifiedDate column in the Shift table to the current date. 
[Person].[uAddress]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[Address]AFTER UPDATE trigger setting the ModifiedDate column in the Address table to the current date. 
[Person].[uAddressType]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[AddressType]AFTER UPDATE trigger setting the ModifiedDate column in the AddressType table to the current date. 
[Person].[uContact]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[Contact]AFTER UPDATE trigger setting the ModifiedDate column in the Contact table to the current date. 
[Person].[uContactType]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[ContactType]AFTER UPDATE trigger setting the ModifiedDate column in the ContactType table to the current date. 
[Person].[uCountryRegion]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[CountryRegion]AFTER UPDATE trigger setting the ModifiedDate column in the CountryRegion table to the current date. 
[Person].[uStateProvince]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Person].[StateProvince]AFTER UPDATE trigger setting the ModifiedDate column in the StateProvince table to the current date. 
[Production].[uBillOfMaterials]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[BillOfMaterials]AFTER UPDATE trigger setting the ModifiedDate column in the BillOfMaterials table to the current date. 
[Production].[uCulture]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[Culture]AFTER UPDATE trigger setting the ModifiedDate column in the Culture table to the current date. 
[Production].[uDocument]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[Document]AFTER UPDATE trigger setting the ModifiedDate column in the Document table to the current date. 
[Production].[uIllustration]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[Illustration]AFTER UPDATE trigger setting the ModifiedDate column in the Illustration table to the current date. 
[Production].[uLocation]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[Location]AFTER UPDATE trigger setting the ModifiedDate column in the Location table to the current date. 
[Production].[uProduct]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[Product]AFTER UPDATE trigger setting the ModifiedDate column in the Product table to the current date. 
[Production].[uProductCategory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductCategory]AFTER UPDATE trigger setting the ModifiedDate column in the ProductCategory table to the current date. 
[Production].[uProductCostHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductCostHistory]AFTER UPDATE trigger setting the ModifiedDate column in the ProductCostHistory table to the current date. 
[Production].[uProductDescription]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductDescription]AFTER UPDATE trigger setting the ModifiedDate column in the ProductDescription table to the current date. 
[Production].[uProductDocument]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductDocument]AFTER UPDATE trigger setting the ModifiedDate column in the ProductDocument table to the current date. 
[Production].[uProductInventory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductInventory]AFTER UPDATE trigger setting the ModifiedDate column in the ProductInventory table to the current date. 
[Production].[uProductListPriceHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductListPriceHistory]AFTER UPDATE trigger setting the ModifiedDate column in the ProductListPriceHistory table to the current date. 
[Production].[uProductModel]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductModel]AFTER UPDATE trigger setting the ModifiedDate column in the ProductModel table to the current date. 
[Production].[uProductModelIllustration]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductModelIllustration]AFTER UPDATE trigger setting the ModifiedDate column in the ProductModelIllustration table to the current date. 
[Production].[uProductModelProductDescriptionCulture]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductModelProductDescriptionCulture]AFTER UPDATE trigger setting the ModifiedDate column in the ProductModelProductDescriptionCulture table to the current date. 
[Production].[uProductPhoto]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductPhoto]AFTER UPDATE trigger setting the ModifiedDate column in the ProductPhoto table to the current date. 
[Production].[uProductProductPhoto]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductProductPhoto]AFTER UPDATE trigger setting the ModifiedDate column in the ProductProductPhoto table to the current date. 
[Production].[uProductReview]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductReview]AFTER UPDATE trigger setting the ModifiedDate column in the ProductReview table to the current date. 
[Production].[uProductSubcategory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ProductSubcategory]AFTER UPDATE trigger setting the ModifiedDate column in the ProductSubcategory table to the current date. 
[Production].[uScrapReason]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[ScrapReason]AFTER UPDATE trigger setting the ModifiedDate column in the ScrapReason table to the current date. 
[Production].[uTransactionHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[TransactionHistory]AFTER UPDATE trigger setting the ModifiedDate column in the TransactionHistory table to the current date. 
[Production].[uTransactionHistoryArchive]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[TransactionHistoryArchive]AFTER UPDATE trigger setting the ModifiedDate column in the TransactionHistoryArchive table to the current date. 
[Production].[uUnitMeasure]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[UnitMeasure]AFTER UPDATE trigger setting the ModifiedDate column in the UnitMeasure table to the current date. 
[Production].[iWorkOrder]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Insert   [Production].[WorkOrder]AFTER INSERT trigger that inserts a row in the TransactionHistory table. 
[Production].[uWorkOrder]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[WorkOrder]AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in the WorkOrder table. 
[Production].[uWorkOrderRouting]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Production].[WorkOrderRouting]AFTER UPDATE trigger setting the ModifiedDate column in the WorkOrderRouting table to the current date. 
[Purchasing].[uProductVendor]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[ProductVendor]AFTER UPDATE trigger setting the ModifiedDate column in the ProductVendor table to the current date. 
[Purchasing].[iPurchaseOrderDetail]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Insert   [Purchasing].[PurchaseOrderDetail]AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column. 
[Purchasing].[uPurchaseOrderDetail]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[PurchaseOrderDetail]AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column. 
[Purchasing].[uPurchaseOrderHeader]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[PurchaseOrderHeader]AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the PurchaseOrderHeader table. 
[Purchasing].[uShipMethod]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[ShipMethod]AFTER UPDATE trigger setting the ModifiedDate column in the ShipMethod table to the current date. 
[Purchasing].[dVendor]Oct 14 2005 1:59AMOct 14 2005 1:59AMInstead of Delete   [Purchasing].[Vendor]INSTEAD OF DELETE trigger which keeps Vendors from being deleted. 
[Purchasing].[uVendor]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[Vendor]AFTER UPDATE trigger setting the ModifiedDate column in the Vendor table to the current date. 
[Purchasing].[uVendorAddress]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[VendorAddress]AFTER UPDATE trigger setting the ModifiedDate column in the VendorAddress table to the current date. 
[Purchasing].[uVendorContact]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Purchasing].[VendorContact]AFTER UPDATE trigger setting the ModifiedDate column in the VendorContact table to the current date. 
[Sales].[uContactCreditCard]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[ContactCreditCard]AFTER UPDATE trigger setting the ModifiedDate column in the ContactCreditCard table to the current date. 
[Sales].[uCountryRegionCurrency]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[CountryRegionCurrency]AFTER UPDATE trigger setting the ModifiedDate column in the CountryRegionCurrency table to the current date. 
[Sales].[uCreditCard]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[CreditCard]AFTER UPDATE trigger setting the ModifiedDate column in the CreditCard table to the current date. 
[Sales].[uCurrency]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[Currency]AFTER UPDATE trigger setting the ModifiedDate column in the Currency table to the current date. 
[Sales].[uCurrencyRate]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[CurrencyRate]AFTER UPDATE trigger setting the ModifiedDate column in the CurrencyRate table to the current date. 
[Sales].[uCustomer]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[Customer]AFTER UPDATE trigger setting the ModifiedDate column in the Customer table to the current date. 
[Sales].[uCustomerAddress]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[CustomerAddress]AFTER UPDATE trigger setting the ModifiedDate column in the CustomerAddress table to the current date. 
[Sales].[iuIndividual]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update Insert   [Sales].[Individual]AFTER INSERT, UPDATE trigger inserting Individual only if the Customer does not exist in the Store table and setting the ModifiedDate column in the Individual table to the current date. 
[Sales].[iduSalesOrderDetail]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update Delete Insert   [Sales].[SalesOrderDetail]AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column. 
[Sales].[uSalesOrderHeader]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesOrderHeader]AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables. 
[Sales].[uSalesOrderHeaderSalesReason]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesOrderHeaderSalesReason]AFTER UPDATE trigger setting the ModifiedDate column in the SalesOrderHeaderSalesReason table to the current date. 
[Sales].[uSalesPerson]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesPerson]AFTER UPDATE trigger setting the ModifiedDate column in the SalesPerson table to the current date. 
[Sales].[uSalesPersonQuotaHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesPersonQuotaHistory]AFTER UPDATE trigger setting the ModifiedDate column in the SalesPersonQuotaHistory table to the current date. 
[Sales].[uSalesReason]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesReason]AFTER UPDATE trigger setting the ModifiedDate column in the SalesReason table to the current date. 
[Sales].[uSalesTaxRate]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesTaxRate]AFTER UPDATE trigger setting the ModifiedDate column in the SalesTaxRate table to the current date. 
[Sales].[uSalesTerritory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesTerritory]AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritory table to the current date. 
[Sales].[uSalesTerritoryHistory]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SalesTerritoryHistory]AFTER UPDATE trigger setting the ModifiedDate column in the SalesTerritoryHistory table to the current date. 
[Sales].[uShoppingCartItem]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[ShoppingCartItem]AFTER UPDATE trigger setting the ModifiedDate column in the ShoppingCartItem table to the current date. 
[Sales].[uSpecialOffer]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SpecialOffer]AFTER UPDATE trigger setting the ModifiedDate column in the SpecialOffer table to the current date. 
[Sales].[uSpecialOfferProduct]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[SpecialOfferProduct]AFTER UPDATE trigger setting the ModifiedDate column in the SpecialOfferProduct table to the current date. 
[Sales].[iStore]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Insert   [Sales].[Store]AFTER INSERT trigger inserting Store only if the Customer does not exist in the Individual table. 
[Sales].[uStore]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[Store]AFTER UPDATE trigger setting the ModifiedDate column in the Store table to the current date. 
[Sales].[uStoreContact]Oct 14 2005 1:59AMOct 14 2005 1:59AMAfter Update   [Sales].[StoreContact]AFTER UPDATE trigger setting the ModifiedDate column in the StoreContact table to the current date. 



Documentation generated by SqlSpec