Cannot alter column '%.*ls' to be data type %.*ls

Error Message:
Msg 4927, Level 16, State 1, Line 1
Cannot alter column ‘%.*ls’ to be data type %.*ls.

Severity level:
16.

Description:
This error message appears when you try to change the data type of a column from one type to another, but that conversion is not allowed.

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 conversion cannot be executed and the statement has to be changed.

Versions:
All versions of SQL Server

Example(s):
CREATE TABLE t
(
 c1 VARCHAR(MAX)
)
GO
ALTER TABLE t
 ALTER COLUMN c1 TIMESTAMP
GO
DROP TABLE t

Remarks:
In the above example we try to change the type of a column from VARCHAR(MAX) to TIMESTAMP. As this conversion is not allowed the error is raised.

]]>

Leave a comment

Your email address will not be published.