Write a script that creates and calls a stored procedure

Assignment Help Computer Engineering
Reference no: EM132174987

using SQL Server. Myguitarshop database.

1.Write a script that creates and calls a stored procedure named spInsertProduct that inserts a row into the Products table.

This stored procedure should accept five parameters/arguments. One parameter/argument for each of these columns:

CategoryID (int), ProductCode (varchar), ProductName (varchar), ListPrice (smallmoney), and DiscountPercent (decimal). In the procedure, validate the following: If the value for the ListPrice column is a negative number, the stored procedure should throw an error (using THROW) that indicates that this column doesn't accept negative numbers.

If the value for the DiscountPercent column is a negative number, the stored procedure should also throw a similar error (using THROW). When inserting data into the Products table, set the Description column to an empty string and set the DateAdded column to the current date.

2. Code at least two EXEC statements that test this procedure (one successful, one failure)

Reference no: EM132174987

Questions Cloud

Using sql developer create user user : As user1 update the last name of the customer with customer ID 188. Explain results.
Basis for classifying the hibiscus flower : Carolus Linnaeus wanted to classify the hibiscus flower. He began by examining the color of the flower, its petal shape, its petal numbers, and the arrangement
How much revenue did the company that entered : If the company whose product entered the market on time earned a total revenue of $25 million.
Did the geneticist isolate the wrong dna : Upon comparison she notes that the DNA sequence is 1000bp longer than the mRNA sequence. Did the geneticist isolate the wrong DNA?
Write a script that creates and calls a stored procedure : Write a script that creates and calls a stored procedure named spInsertProduct that inserts a row into the Products table.
Cellular respiration and for anaerobic respiration : If the one molecule of ATP releases 30.5 kJ/mol or 7.3 kcal/mol, calculate the theoretical efficiency (showing your work) for cellular respiration
Create a trigger for auditing : Create a trigger for auditing ?create trigger audit_customers on the Custoners table.
What could we conclude about those results : After boiling the saliva and adding the starch, we added 5 drops of HCL and incubated the tube in an ice bath before testing for the presence of maltose.
Questions for animal adaptations : What are detrivores What are substrate feeders What is another name for a suspension feeder:

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design a class that represents a star

Design a class that represents a star with a specified radius and color. Use a filled polygon to draw the star. Design and implement a program that draws.

  Why the file manager should grant such requests

why the file manager should grant such requests.

  Explaining the trust/security domain boundaries

Recognize and explain Trust/Security Domain boundaries which may be applicable to the personal computer (workstation) security in the business context.

  Write a command that will tell me the unique files

For example, "favicon.ico" is one. Write a command that will tell me the unique files that have been accessed. All of GET, HEAD, and POST count.

  Difference between passive and active security threats

What is the difference between passive and active security threats? List and briefly define categories of passive and active security attacks.

  Write a program that compute the average of five exam scores

Write a program that computes the average of five exam scores. Declare and perform a compile-time initialization with the five values.

  Describe a way in which string object might store characters

When using a String object, you do not know how it stores its characters. Describe a way in which a String object might store its characters.

  Describe the high-level business model of your company

Describe the high-level business model of your company and the typical problems (at least 5) faced by users.

  Discuss the heat transfer process

A 150-mm-diameter and 1-m-long rod is positioned horizontally and has water flowing across its outer surface at a velocity of 0.2 m/s.

  Write a java console program that read a text string

Create a static method fillArray() that would accept array of 1000 int as the only parameter and would initialize them randomly.

  Analyze how the data breach could have been prevented

Analyze how the data breach could have been prevented with better adherence to and compliance with regulatory requirements and guidelines.

  Current problems in computer systems

IMAT5122 – Computer Systems and Networks - Linux System Change Logger Script - Demonstrate a systematic understanding of knowledge

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd