Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the SmartHomes database do the following: Create and run a stored procedure (write code) in SQL Server to take in a customer ID, product
Using the SmartHomes database do the following: Create and run a stored procedure (write code) in SQL Server to take in a customer ID, product ID, and quantity. Test the three executions of the stored procedure (that include valid and invalid data) to help test extraneous information. Explain how the transaction is executed within the stored procedure. To ensure data integrity, we need to validate that the existing quantity of the product table has enough items before the stored procedure is executed. This can be done using a trigger. Create a trigger in SQL Server to execute when the transaction is performed in the stored procedure. The trigger should be based on the update of the product table to check if the current quantity has enough items to deduct the updated quantity. Test three executions of the trigger with various inputs (that include valid and invalid data) to test for extraneous information.
Step by Step Solution
★★★★★
3.36 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
Here is the code for the stored procedure T...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started