exam questions

Exam 70-761 All Questions

View all questions & answers for the 70-761 exam

Exam 70-761 topic 1 question 130 discussion

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

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section. You will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have a database that contains a single table named tblVehicleRegistration. The table is defined as follows:

You run the following query:

The query output window displays the following error message: "Conversion failed when converting the varchar value "˜AB012' to data type int."
You need to resolve the error.
Solution: You modify the Transact-SQL statement as follows:

Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
supermario
Highly Voted 5 years, 3 months ago
The conversion error happens in Registration Number which is not fixed. Registration date doesnt matter here
upvoted 6 times
Anette
5 years ago
but it works when tested. Any idea?
upvoted 1 times
...
...
chaoxes
Highly Voted 4 years, 11 months ago
Correct answer is B. No, because it will throw conversion error on line #2. If value 20012 would be quoted or convereted, query would work. Tested it. This would work: select userid from tblvehicleregistration where registrationnumber = '20012' and registrationdate > CONVERT(DATE, '2016-01-01', 120) RegistrationNumber = 20012 throws error.
upvoted 6 times
VanillaS
4 years, 7 months ago
It works even without quotes for registration no due to implicit conversion , it’s A I tested
upvoted 2 times
...
...
Billybob0604
Most Recent 4 years, 5 months ago
Answer A is just fine. Tested it.
upvoted 1 times
...
Vermonster
4 years, 5 months ago
B is correct - @BabyBee there is no implicit conversion in the WHERE clause - look 2 questions back
upvoted 1 times
...
Skc20
4 years, 6 months ago
Tested..B is CORRECT answer.
upvoted 1 times
...
BabyBee
4 years, 7 months ago
The query runs fine as there is an implicit conversion from Int to String @ RegistrationNumber = 20012, and the date is also fine. Think answer is A.
upvoted 1 times
...
TomAbg
4 years, 7 months ago
A is Correct
upvoted 2 times
...
Anette
5 years ago
it seems to be OK. I tested and it is A
upvoted 1 times
Andy7622
4 years, 6 months ago
it can't be ok . because registration number accepts only letter and numbers so it's string You can't filter string with integer because it has higher precedence level.
upvoted 2 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 ...