Test the procedure by running the following execution statements , Exec spEmpTotals Exec spEmpTotals 'M% (This SP
Fantastic news! We've Found the answer you've been seeking!
Question:
Test the procedure by running the following execution statements ,
Exec spEmpTotals
Exec spEmpTotals 'M%
Transcribed Image Text:
(This SP will return a total of all hours an employee has worked during a given time period) Create a stored procedure named spEmpTotals that includes 3 input variables: @LastName (varchar(50)) @StartDate (smalldatetime) @EndDate (smalldatetime) Initially set LastName so that it defaults to returning every record if no value in input and set the 2 date variable to NULL. Next, test for null values in the date variables, if null is present, set both variables to the appropriate MIN or MAX value that exists in the PerFrom column of PayPeriod. Select the following columns: EmpName (concatenation of FirstName and LastName with a space between) TotWkHours (sum of WorkHours column) TotHolHours (sum of HolHours column) TotSickHours (sum of SickHours column) TotVacHours (sum of VacHours column) TotPersHours (sum of PersHours column) Filter the results where LastName is like the appropriate input variable and PerFrom column is valued between the two appropriate input variables. Group the query accordingly and sort the results by TotWkHours from largest to smallest (This SP will return a total of all hours an employee has worked during a given time period) Create a stored procedure named spEmpTotals that includes 3 input variables: @LastName (varchar(50)) @StartDate (smalldatetime) @EndDate (smalldatetime) Initially set LastName so that it defaults to returning every record if no value in input and set the 2 date variable to NULL. Next, test for null values in the date variables, if null is present, set both variables to the appropriate MIN or MAX value that exists in the PerFrom column of PayPeriod. Select the following columns: EmpName (concatenation of FirstName and LastName with a space between) TotWkHours (sum of WorkHours column) TotHolHours (sum of HolHours column) TotSickHours (sum of SickHours column) TotVacHours (sum of VacHours column) TotPersHours (sum of PersHours column) Filter the results where LastName is like the appropriate input variable and PerFrom column is valued between the two appropriate input variables. Group the query accordingly and sort the results by TotWkHours from largest to smallest
Expert Answer:
Answer rating: 100% (QA)
To create the stored procedure spEmpTotals and test it with the provided execution statements you ca... View the full answer
Related Book For
Auditing a business risk appraoch
ISBN: 978-0324375589
6th Edition
Authors: larry e. rittenberg, bradley j. schwieger, karla m. johnston
Posted Date:
Students also viewed these databases questions
-
What challenges did Coca-Cola face during the planning selection of a software vendor?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. The Incisors own a rental beach house in Hawaii. The beach house was rented for the full year during 2012...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A three-dimensional elasticity problem of a uniform bar stretched under its own weight gives the following strain field: where A and B are constants. Integrate the strainedisplacement relations to...
-
The manager of Motel 11 has 316 rooms in Palo Alto, California. From observation over a long period of time, she knows that on an average night, 268 rooms will be rented. The long-term standard...
-
Develop a performance appraisal method for the workers and managers in each store.
-
Marie has 11,000 that she wishes to invest for one year. She has narrowed her choices down to one of the following two actions: a : Buy bonds of Risky Mining Ltd. These pay 14.4% interest, unless...
-
Reba Dixon is a fifth-grade school teacher who earned a salary of $38,000 in 2020. She is 45 years old and has been divorced for four years. She receives $1,200 of alimony payments each month from...
-
Nuco, Inc., has 75% of its sales, 30% of its property, and 60% of its payroll in State X, which uses an equally weighted sales formula for income tax apportionment. What percentage of Nuco's income...
-
Identify, discuss and apply the major challenges that have been highlighted by Okoye (2015), which sanction the need for a focus in risk, compliance and control structures in relation to Prasa as...
-
Big Time Investor Group is opening an office in Dallas. Fixed monthly costs are office rent (\($8,200)\), depreciation on office furniture (\($1,500),\) utilities (\($2,300),\) special telephone...
-
Country Road Driving School charges \($230\) per student to prepare and administer written and driving tests. Variable costs of \($70\) per student include trainers wages, study materials, and...
-
A refrigerator used by a meat processor has a cost of \($138,000,\) an estimated residual value of \($10,000,\) and an estimated useful life of 10 years. What is the amount of the annual depreciation...
-
Sheehan Metal Casting Co. reported \($625,000\) for equipment and \($310,000\) for accumulated depreciation on its balance sheet. Does this mean (a) that the replacement cost of the equipment is...
-
Langley Delivery Company acquired an adjacent lot to construct a new warehouse, paying \($30,000\) and giving a short-term note for \($90,000.\) Legal fees paid were \($3,500,\) delinquent taxes...
-
What are the uncertainties that influence supply chain performance and network design?
-
Would you use the adjacency matrix structure or the adjacency list structure in each of the following cases? Justify your choice. a. The graph has 10,000 vertices and 20,000 edges, and it is...
-
It has been generally asserted that a standard of due care was sufficient to meet the negligence standard. Yet the chapter also indicates that the court system has been an influence on the...
-
Why is it so important that a sample be as representative of the population as possible?
-
A CPA's audit documentation contains a narrative description of a segment of the Crayden Factory, Inc., payroll system and an accompanying flowchart as follows: ¢ The internal control structure...
-
Use properties of the real numbers and mental math to calculate the following: 1. \(2 \times 13 \times 50\) 2. \(13+84+27\) 3. \(9 \times 16 \times 11\)
-
In each of the following, identify which property of the real numbers is being applied. 1. \(4+(8+13)=(4+8)+13\) 2. \(34 \times\left(\frac{1}{34} ight)=1\) 3. \(14+27=27+14\)
-
Find the value of the following numbers modulo 12 : 1. 34 2. 539 3. 156
Study smarter with the SolutionInn App