# SQL Server Rule: SRP0016
| | |
|----|----|
| Assembly | SqlServer.Rules |
| Namespace | SqlServer.Rules.Performance |
| Class | DataTypesOnBothSidesOfEqualityRule |
## Rule Information
| | |
|----|----|
| Id | SRP0016 |
| Friendly Name | Equality test with mismatched types |
| Category | Performance |
| Ignorable | false |
| Applicable Types | Procedure |
| | Scalar Function |
| | Table Valued Function |
| | View |
## Description
Data types on both sides of an equality check should be the same in the where clause. (Sargable)
## Summary
Data types on both sides of an equality check should be the same in the where clause. (Sargeable)
### Examples
```sql
Create Procedure dbo.CursorTest
as
Set nocount on;
DECLARE vendor_cursor CURSOR FOR
SELECT Col1, Col2
FROM [dbo].[TestTableSSDT]
WHERE Col3=1
ORDER BY Col1;
-- SML029, SRP0016
```
### Remarks
When fields of different data types are joined on or compared, if they are not the same data
type, one type will be implicitly converted to the other type. Implicit conversion can lead
to data truncation and to performance issues appears in query filter.
<sub><sup>Generated by a tool</sup></sub>