Homework Help Question & Answers

Write a trigger titled tgrExcessInventory for Production Inventory table to ensure the quantity can never exceed 800 uni...

Write a trigger titled tgrExcessInventory for Production Inventory table to ensure the quantity can never exceed 800 units. Adventure Works 2016CTP

Then modify the trigger created in step 1 to execute its check code only if the quantity column is updated.

0 0
Next > < Previous
ReportAnswer #1

CREATE TRIGGER trgExcessInventory

On production.ProductInventory

FOR UPDATE

AS

IF EXISTS

(SELECT 'True'

FROM Inserted i

JOIN Deleted d

ON i.productID= d.ProductID

AND i.locationID=d.LocationID

WHERE (d.quantity+ i.quantity) >=800 OR

i.quantity >=800

)Begin

RAISERROR( 'Cant increase supply where units would be over 800 units',16,1)

ROLLBACK TRAN

END

Know the answer?
Add Answer of:
Write a trigger titled tgrExcessInventory for Production Inventory table to ensure the quantity can never exceed 800 uni...
Your Answer: Your Name: What's your source?
Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Overloaded Methods and Static Methods / Variables

    Scenario and SummaryThe objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the mainclass.Increment numEmployees in all of the constructors.Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two "set" methods for both dependents and...

  • lab problem

    The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the mainclass.Increment numEmployees in all of the constructors.Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two "set" methods for both dependents and annual salary;...

  • C# Program: Employee Class Using Visual Studio

    Scenario:We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based onthe Employee class, along with a class that contains the main method. The attributes, constructors, and methods for this class must satisfy the requirements inSteps 1 through 3. After you create the objects, you will prompt the user for information and then display it. We will want to ensure that this first class iswell-constructed and tested since...

  • C# Program using Visual Studio: Overloaded Methods and Static Methods / Variables

    Scenario and Summary:The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the mainclass.Increment numEmployees in all of the constructors.Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two "set" methods for both dependents and...

  • Help Required

    x.øi5gn="center"> Case Read the case given below carefully and then answer the questions in the provided excel file. ABC Corporation is a manufacturing firm that makes daily use home appliances. The recent demand pattern for its products is as follows:The firm is deciding to produce a new product. The initial investment is estimated to be Rs.2000. Labor and material cost is Rs.5 per unit. The selling price is set at Rs.10 per unit.The firm uses 700 units of component ‘A’...

  • computing

    x.øi5 face="Times New Roman" size="3">CaseRead the case given below carefully and then answer the questions in the provided excel file.ABC Corporation is a manufacturing firm that makes daily use home appliances. The recent demand pattern for its products is as follows:PeriodUnits1562 613554705666657 72875Table 1The firm is deciding to produce a new product. The initial investment is estimated to be Rs.2000. Labor and material cost is Rs.5 per unit. The selling price is set at Rs.10 per unit.The firm uses 700...

  • can someone help with the blue reader project, please? I have the journal entries I need...

    can someone help with the blue reader project, please? I have the journal entries I need help with journal ledger and trial balance so I can I do the financial statements. thanks can someone help me the ledger and trial balance please, I posted all the information about the picture Credit The accounting cycle illustrated below is designed to provide information about a company's profitability for lack thereof) along with many other important financial characteristics. This same accounting Cycle is...

  • Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales...

    Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales for Crèmes Ice Cream Judd Hemming is the eastern regional marketing manager for Crèmes Ice Cream. Eac quarter, he completes two separate analyses: an analysis comparing ice cream flavor sale volumes from all regional locations with the same quarter sales volumes from the previou year and an analysis comparing total sales in dollars, including mean, median, mode, and standard deviation, of sales by store....

  • FART I TRUE FALSE QUESTIONS (10 points). Please write True (1) or False (F) on the...

    FART I TRUE FALSE QUESTIONS (10 points). Please write True (1) or False (F) on the blank Scarcity is the intimited nature of society's resources given society's limited wants 2. A reward is a type of positive incentive. 3. To remove difficulty of double coincidence of wants we use money. 4. An exogenous factor is a variable that can be controlled for inside the model. 5. The PPF will not have a constant slope. 6. The law of demand states...

  • 1- The Financial VP has expressed concern over the use of supplies expense in your department

    1- The Financial VP has expressed concern over the use of supplies expense in your department. You and he sat down and came up with the following monthly budget formula:Budgeted supplies expense = $21,400 + ($.74 x number of widgets produced)In April, the budgeted production was 100,000 units, giving a budget allowance of $95,400. You actually produced 112,500 units and consumed $101,340 worth of supplies. The VP attached a note to your monthly report saying that you needed to get...

Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
Share Your Knowledge

Post an Article
Post an Answer
Post a Question with Answer

Self-promotion: Authors have the chance of a link back to their own personal blogs or social media profile pages.