DF078: Non-ISO standard comparison operator found.
Last modified: June 12, 2025
The topic describes the DF078 T-SQL code analysis rule.
Category
BEST PRACTICE
Message
Non-ISO standard comparison operator found.
Description
To ensure cross-platform and future version compatibility, it is recommended to use ISO standard comparison operators.
Additional information
Using ISO standard comparison operators is recommended over non-ISO standard operators to ensure optimal cross-platform and future version compatibility. While currently acceptable, keep in mind that statements using non-ISO operators might not be supported on other ISO-compliant database management systems. Additionally, non-ISO standard comparison operators may not be supported in future SQL Server versions.
Replace the Non-ISO comparison operators with ISO standard operators:
- Not equal to: Use
<>
instead of!=
- Greater than or equal to: Use
>=
instead of!<
- Less than or equal to: Use
<=
instead of!>
Noncompliant code example
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id != 10;
GO
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id !> 10;
GO
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id !< 10;
GO
Compliant solution
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id <> 10;
GO
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id <= 10;
GO
SELECT c.FirstName, c.LastName
FROM dbo.Customer c
WHERE c.Id >= 10;
GO
Was this page helpful?