Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem statement Sometimes a database may have a separate table to log certain activities taking place in the database. Create a new table named ChangeLog

Problem statement

Sometimes a database may have a separate table to log certain activities taking place in the database. Create a new table named ChangeLog in the Northwind database as follows:

ChangeID int identity(1,1) primary key EmpID int (will contain the ID of the employee being changed) ChangedBy nvarchar(30) (will contain the login of the user making the change) DateChanged smalldatetime (will contain the date of the change) OldRate money (will contain the old payrate of the employee) NewRate money (will contain the new payrate of the employee)

If you havent already done so (as this was part of the first Northwind project in Assn02), you also need to Alter the Employees table and add a PayRate Column and set a pay rate for the employees.

After creating the ChangeLog table, create a trigger on the Employees table for UPDATE. Use this trigger to monitor the PayRate column, and if the PayRate of an employee gets changed, have the trigger insert a row into the ChangeLog table with the appropriate data. [Use the function suser_sname() to get the user making the change and insert this into the user column.]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

Q.1. Taxonomic classification of peafowl, Tiger and cow ?

Answered: 1 week ago

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago