Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Delete and Update SQL statements - Help

$
0
0

I want to create an audit table to track deletes from vendors2. (from earlier in the test)

CREATE TABLE vendors2 (

vend_id char(10),

vend_name char(50)

);

All the deletes will be stored in a table vendorsaudit with the following structure. 

Assume this table already exists :
CREATE TABLE vendorsaudit (
vend_id char(10),
vend_name char(50),
datedeleted DATETIME
);

Note: the datedeleted column stores a timestamp when the corresponding row was deleted.

Hint: Use a trigger, and there's more than one way to fill in the datedeleted field.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>