PrepAway - Latest Free Exam Questions & Answers

@find varchar(30); SET @find = ‘Man’; SELECT LastName F…

What is wrong with the T-SQL batch statement below.
@find varchar(30);
SET @find = ‘Man’;
SELECT LastName FROM Person WHERE LastName = @find;

PrepAway - Latest Free Exam Questions & Answers

A.
You can’t use the @find parameter in a query

B.
DECLARE is missing

C.
Nothing, it’s fine

D.
You should use SELECT instead of SET

Explanation:
Variables are declared in the body of a batch or procedure with the DECLARE statement and are
assigned values by using either a SET or SELECT statement.


Leave a Reply