Question: Given the following statements that declare a local variable and set its value, which of the following will cause an error? DECLARE @Example1 varchar(128); SET

Given the following statements that declare a local variable and set its value, which of the following will cause an error?

DECLARE @Example1 varchar(128);

SET @Example1 = 'Invoices';

a) PRINT 'Table name is: ' + @Example1;

b)IF @Example1 = 'Invoices'

SELECT * FROM Invoices;

(c) SELECT *

FROM sys.tables

WHERE name = @Example1;

(d) SELECT *

FROM @Example1;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!