Msg 402, Level 16, State 1, Line 3
The data types %s and %s are incompatible in the %s operator.
This error message appears when you try to use an operator with incompatible values of incompatible data types for this operator.
The T-SQL statement can be parsed, but causes the error at runtime.
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.
All versions of SQL Server.
DECLARE @bin BINARY(8)
SELECT @bin = CAST(GETDATE() AS BINARY(8))
SELECT CAST(@bin & CAST(1 AS BINARY(1)) AS DATETIME)
In the above example the error is raised because of the incompatibility between the operator & and the BINARY() data type.