You can use triggers to create timestamps in the table you are inserting or updating, and in other tables too.
- Triggers may also used to create timestamps, … and in this example I'll show you … how to use a trigger to create timestamps … and to update a transaction log. … Here, in, we're using our test database, … and here we're going to drop these … two tables we've created before, … and create them again along with a log table, … so I'm going to execute that. … In our new version of the widget customer table … we have a place for a stamp, for a time and date stamp. … And also in the sale table, and in the widget log table … has columns for ID, stamp and event, text, … username, table name, table ID, … the kind of things you might put in a transaction log. … And so, here we're going to insert some rows … into the customer table, and there they are. … In our little select statement down here. … And now we're going to create a more complex trigger … than we have before. … This one is after insert on widget sale, … and it will be called stamp sale. … This updates the widget sale table … that's just been updated. …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.