The text, ntext, and image data types are invalid for local variables.

Error Message:
Msg 2739, Level 16, State 1, Line 1
The text, ntext, and image data types are invalid for local variables.

Severity level:
16.

Description:
This error message appears when you try to declare of one of the aforementioned types.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. These data types are not valid for variable declarations.

Versions:
All versions of SQL Server.

Example(s):
DECLARE @t TEXT

Remarks:
In the above example we try to declare a variable of the TEXT type. This raises the error.

]]>

Leave a comment

Your email address will not be published.