Question: Write a procedure ArchiveEmployee that will move an employee record to the EmployeeArchive table for storage. The employee can only be archived if they do

Write a procedure ArchiveEmployee that will move an employee record to the EmployeeArchive table for storage. The employee can only be archived if they do not have any sales. An employee number will be passed to this procedure as a parameter. Error messages are required if the employee number does not exist or if the employee cannot be archived because they have sales.

Publisher Category PublisherCode int PK CategoryCode int PK Name varchar(40) Description varchar(40) Employee Customer Title Author EmployeeNumber int PK CustomerNumber int PK ISBN char(10) PK AuthorCode int PK SIN char(9) FirstName varchar(30) Title varchar(40) FirstName (O) varchar(30) FirstName varchar(30) LastName varchar(30) SuggestedPrice smallmoney LastName varchar(30) LastName varchar(30) Address (O) varchar(40) NumberInStock smallint Address (O) varchar(40) City (O) varchar(30) PublisherCode (FK) int City (O) varchar(20) Province (O) char(2) CategoryCode (FK) int Province (O) char(2) PostalCode (O) char(6) PostalCode (O) char(6) HomePhone (O) char(10) HomePhone (O) char(10) WorkPhone (O) char(10) WorkPhone (O) char(10) EmailAddress (O) varchar(30) Email (O) varchar(40) ActiveYN char(1) Sale AuthorTitle SaleNumber int PK ISBN (FK) char(10) SaleDate datetime AuthorCode (FK) int SubTotal money GST money Total money EmployeeNumber (FK) int CustomerNumber (FK) int EmployeeArchive EmployeeNumber int PK SIN char(9) SaleDetail FirstName varchar(30) Legend SaleNumber (FK) int LastName varchar(30) ISBN (FK) char(10) Address (O) varchar(40) One Many SellingPrice money City (O) varchar(20) Primary Key - PK Quantity int Province (O) char(2) Foreign Key - FK Amount money PostalCode (O) char(6) HomePhone (O) char(10) WorkPhone (O) char(10) Email (O) varchar(40) ActiveYN char

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!