~~ Hello, These are the two labs that I need help with. If you could, just do the sandbox part to both questions and just send me the codes so I can submit ~~ 1. Create a stored procedure named...

2 answer below »
need work done in my sandbox, send me codes in a doc


~~ Hello, These are the two labs that I need help with. If you could, just do the sandbox part to both questions and just send me the codes so I can submit ~~ 1. Create a stored procedure named OrderCount that has an input parameter of CustomerID. It will then count number of orders for that customer. This procedure also needs to have the recompile option turned on since the results set can vary widely. This stored procedure must access the information from the [Orders Qry] view. When the CustomerID parameter is entered, it will select the information from the above mentioned View, and count and return the amount of orders that customer placed. (Hint: return @@ROWCOUNT) In other words, the procedure returns a count of the total number of orders for any particular CustomerID that is entered when the stored procedure is executed. All work needs to be done in your sandbox. Evidence of testing needs to be shown as well. See the In Preparation for Week10 doc for additional helpful information. You can paste your code here, but it still needs to be found in your sandbox for verification. 2. All work needs to be done in your sandbox. Create a stored procedure called FindCompanyName that uses the CustomerID as input and an output variable called CompanyName which needs to be the same datatype and length as the CompanyName column. You will be using the Customers table in this exercise. Print the CompanyName out to the Message tab. You need to test your procedure in to prove that it correctly works. You can test your stored procedure using the following example: Declare @Name nvarchar(40) exec FindCompanyName 'alfki', @Name Output Print @Name If successful the value of 'Alfreds Futterkiste' should be printed out. 3. All work needs to done in the sandbox. It must have been tested as well. Write a stored procedure that will insert a single row into the [Order Details] table. This code must be inside a Try-Catch block and return an appropriate error message if the insert fails. Name the stored procedure Insert_OrderDetails. Do not hardcode the values in, but instead use something like what is found on stackoverflow. Use parameters to submit the values. To get access to sandbox follow these steps.. 1. Download our vpn (https://www.uc.edu/about/ucit/services/connectivity-fac-staff/vpn.html). This allows you to connect to sandbox. 2. Log in to vpn [ USER - jasperjz / PASS - Batman102.] ~Dont forget the period in the pw. 3. You will see this, Hit “Send Me a Push”. It will notify me and I will have to hit accept on my end. 4. Once I let you in , in google chrome, open an incognito window, within that incognito window… go here (https://sandbox02.cech.uc.edu/vcac/). Select domain “ad.uc.edu”..then it will prompt you for the same information, just use the same login cred you used for the vpn. 5. Follow screenshots, here you will land on this page.Click deployments tab. 6. Here you will scroll down and click DB2442 gear option → Connect to remote.. 7. Once it loads the remote, the password is “Pa$$w0rd”. You will be logged in to the desktop and you will have to get on microsoft sql server, once sql loads you should be able to log right in.. if the window pops up just hit connect. ..All done.
Answered 76 days AfterOct 27, 2021

Answer To: ~~ Hello, These are the two labs that I need help with. If you could, just do the sandbox part to...

Neha answered on Jan 12 2022
115 Votes
1)
CREATE PROCEDURE OrdersQry.OrderCount @CustomerID INT
AS
IF @CustomerID IS NOT NULL
BEGIN

PRINT 'You must give a CustomerID';
RETURN ;
END
ELSE
BEGIN
SELECT SUM(o.UnitPrice)
FROM OrdersDetails o INNER JOIN Orders l
ON o.OrderID = l.OrderID
WHERE l.CustomerID = @CustomerID;
END;
END;
SELECT...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here