You have a database named Sales that contains the tables shown in the exhibit. (Click the Exhibit button.)
You have an application named Appl. You have a parameter named @Count that uses the int data type. App1 is configured to pass @Count to a stored procedure.
You need to create a stored procedure named usp_Customers for App1 that returns only the number of rows specified by the @Count parameter. The solution must
NOT use BEGIN and END statements. Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.

Answer: See the explanation
Explanation:
CREATE PROCEDURE usp_Customers @Count int SELECT TOP(@Count) Customers.LastName FROM Customers ORDER BY
Customers.LastName
correct
0
4
Missing “AS” keyword:
CREATE [ OR ALTER ] { PROC | PROCEDURE }
[schema_name.] procedure_name [ ; number ]
[ { @parameter [ type_schema_name. ] data_type }
[ VARYING ] [ = default ] [ OUT | OUTPUT | [READONLY]
] [ ,…n ]
[ WITH [ ,…n ] ]
[ FOR REPLICATION ]
AS { [ BEGIN ] sql_statement [;] [ …n ] [ END ] }
[;]
2
0
Why is there an Order By included? The question hasn’t specified that this must be included
0
0
Never mind – I didn’t realise it was included in part of the existing code
0
0
CREATE PROCEDURE usp_Customers
(@Count int)
AS
SELECT TOP(Count) LastName
From Customers
Order By LastName
GO
0
0