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.




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |