This code runs:
USE pubs
DECLARE @s VARCHAR(50)
SET @s = 'SELECT * FROM publishers'
EXEC (@s)
What if @s is greater than VARCHAR(8000)? If I replace VARCHAR with TEXT, I get an error message: "The text, ntext, and image data types are invalid for local variables".
USE pubs
DECLARE @s VARCHAR(50)
SET @s = 'SELECT * FROM publishers'
EXEC (@s)
What if @s is greater than VARCHAR(8000)? If I replace VARCHAR with TEXT, I get an error message: "The text, ntext, and image data types are invalid for local variables".