exam questions

Exam 70-461 All Questions

View all questions & answers for the 70-461 exam

Exam 70-461 topic 1 question 171 discussion

Actual exam question from Microsoft's 70-461
Question #: 171
Topic #: 1
[All 70-461 Questions]

SIMULATION -
You have a data warehouse that contains the data for all the customers of your company.
You need to create a stored procedure that generates a list of customer addresses. The list must meet the following requirements:
✑ The procedure must accept a string value.
✑ The procedure should return all customers who reside in a city whose name begins with the provided value.
✑ If a user provides a blank value, the procedure must execute, and then return a blank result set.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within code that has been provided as well as below it.


Show Suggested Answer Hide Answer
Suggested Answer: Please review the explanation part for this answer.
1 CREATE PROCEDURE uspGetAddress @City nvarchar(50) = ""
2 AS
3 SELECT *
4 FROM Person.Address
5 WHERE City LIKE @City *
6 GO
On line 1 add "" (set the default value)
On line 5 add LIKE (use string comparison)

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Nickforguest
4 years, 5 months ago
This query doesn't return a blank rrsult set od a User provide blank value
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...