Question
Please download the database from the following link: https://drive.google.com/drive/folders/11FLfdYZUbIDxLuifwLcZfb9sMxGBnPiI Question: Use the NorthWind database Write and submit a create stored procedure statement for a stored
Please download the database from the following link:
https://drive.google.com/drive/folders/11FLfdYZUbIDxLuifwLcZfb9sMxGBnPiI
Question:
Use the NorthWind database
Write and submit a create stored procedure statement for a stored procedure named EmpOrderCount in the dbo schema that takes a territoryid as a parameter. The parameter must be named TerritoryID. The parameter should default to null. The stored proc should not return the rowcount. The stored proc should raise a SQL Server error with a severity of 11, a message saying @TerritoryID not in table with a state of 1 when the given @TerritoryID is not in the Territories table.
Here is an example execution for the null situation:
Here is an example execution for a not null situation:
Here is an example with a value for @TerritoryID thats not in the Territories table
EXEC dbo. EmpOrderCount 100 % Results Sales Person Territory Orders Buchanan, Steve Callahan, Laura Davolio, Naney Dodsworth, Anne Fuller, Andrew King, Robert Leverling, Janet eacoCk, Margaret Suyama, Michael A1l Territorie 42 All Territoriea 104 A1l Territorie 12 3 A1l Territories 43 A1l Territories 9 All Territoriea 72 All Territoriea 127 All Territoriea 15E All Territoriea 67 9 rowis) affected)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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