Question: . Using the AdventureWorks database implement and test the History data auditing model for UPDATE and DELETE actions on any table create table Address with
. Using the AdventureWorks database implement and test the History data auditing model for UPDATE and DELETE actions on any table
create table Address with 3 columns with the same structure as the original table + hist_date + username + hist_id + operation_type
Table properties
| name | value |
|---|---|
| name | [Person].[Address] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM |
| ansi nulls | on |
| quoted identifier | on |
| row count | 19,614 |
| Size of data | 2,240 kb |
| Size of indexes | 2,504 kb |
| Maximum size of a single row | 692 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|---|---|---|---|---|---|---|---|---|---|
| AddressID | int identity(1,1) | 10 | 4 | no | yes | no | Primary key for Address records. | |||
| AddressLine1 | nvarchar(60) | 60 | 240 | no | no | First street address line. | ||||
| AddressLine2 | nvarchar(60) | 60 | 240 | yes | no | Second street address line. | ||||
| City | nvarchar(30) | 30 | 120 | no | no | Name of the city. | ||||
| StateProvinceID | int | 10 | 4 | no | StateProvince.StateProvinceID | no | Unique identification number for the state or province. Foreign key to StateProvince table. | |||
| PostalCode | nvarchar(15) | 15 | 60 | no | no | Postal code for the street address. | ||||
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no | no | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no | no | Date and time the record was last updated. |
Indexes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
