Write a stored procedure that inserts a new record to the HumanResources.EmployeePayHistory table. The procedure should accept parameters for the BusinessEntityID, RateChangeDate, Rate, and PayFrequency fields.
a. The PayFrequency field should default to a value of 2 if no value is passed in the parameter.
b. The RateChangeDate field should default to today’s date if no value is passed in the parameter. (HINT: you cannot assign the GETDATE() function directly to the parameter declaration. This needs to be done in the body of the procedure.)
c. If the BusinessEntityD that is passed in the parameter does not exist in the HumanResources.Employee table, the procedure should output an error message on the screen and the procedure should stop running. d. If the PayFrequency field does not contain either a 1 or 2 as a value, the procedure should output an error message to the user and stop running.