The data types %s and %s are incompatible in the %s operator.

Error Message:
Msg 402, Level 16, State 1, Line 3
The data types %s and %s are incompatible in the %s operator.

Severity level:
16.

Description:
This error message appears when you try to use an operator with incompatible values of incompatible data types for this operator.

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 data types must be compatible for the chosen operator.

Versions:
All versions of SQL Server.

Example(s):
DECLARE @bin BINARY(8)
SELECT @bin = CAST(GETDATE() AS BINARY(8))
SELECT CAST(@bin & CAST(1 AS BINARY(1)) AS DATETIME)

Remarks:
In the above example the error is raised because of the incompatibility between the operator & and the BINARY() data type.




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 |