You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`!=`][12]|[`<>`][12]|`<>` is [`ANSI`], `!=` not `ANSI`, [`<>` and `!=` are identical][13]|[13]|
205
-
|[`CONVERT`][10]|[`CAST`][10]|`CAST` is [`ANSI`]|[14],[15]|
206
-
|[`ISNULL`]|[`COALECSE`]|`COALECSE` is [`ANSI`] and supports more than two arguments, `ISNULL` has dangerous behaviour with possibility to implicit triming string |[16],[17]|
207
-
|[`DATEDIFF`]|[`DATEADD`]| The predicate `MyDateTime < DATEADD(SECOND, -1, GETUTCDATE())` syntax is [`SARGable`]|[18],[19]|
208
-
|[`SELECT`]|[`SET`]| Using `SET` (is [`ANSI`]) instead of `SELECT` when assigning variables due to properly work with `Msg 501 Subquery returned more than 1 value`|[20],[21],[22]|
209
-
|[`STR`]|[`CAST`][10]|`STR` is not [`ANSI`], extremly slow, don't use more than 15 digits, and has rounding problem - use `CAST` plus concatenate instead `STR`|[23]|
210
-
|[`ISNUMERIC`]|[`TRY_CONVERT`]|`ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. |[24]|
211
-
|[`GETDATE`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
212
-
|[`GETUTCDATE`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
213
-
|[`SYSDATETIME`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
214
-
|[`CURRENT_TIMESTAMP`]|[`SYSUTCDATETIME`]| It's too similar to the poorly-named TIMESTAMP data type, which has nothing to do with dates and times and should be called ROWVERSION. |[26]|
215
-
|[`DATETIMEFROMPARTS`]|[`DATETIME2FROMPARTS`]| It's too similar to the poorly-named TIMESTAMP data type, which has nothing to do with dates and times and should be called ROWVERSION. |[26]|
216
-
|[`ISDATE`]|[`TRY_CONVERT`]|`ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. |[26]|
202
+
| Not Recommended | Recommended | When and Why | More details |
|[`!=`][12]|[`<>`][12]|`<>` is [`ANSI`], `!=` not `ANSI`, [`<>` and `!=` are identical][13]|[13]|
205
+
|[`CONVERT`][10]|[`CAST`][10]|`CAST` is [`ANSI`]|[14],[15]|
206
+
|[`ISNULL`]|[`COALECSE`]|`COALECSE` is [`ANSI`] and supports more than two arguments, `ISNULL` has dangerous behaviour with possibility to implicit triming string |[16],[17]|
207
+
|[`DATEDIFF`]|[`DATEADD`]| The predicate `MyDateTime < DATEADD(SECOND, -1, GETUTCDATE())` syntax is [`SARGable`]|[18],[19]|
208
+
|[`SELECT`]|[`SET`]| Using `SET` (is [`ANSI`]) instead of `SELECT` when assigning variables due to properly work with `Msg 501 Subquery returned more than 1 value`|[20],[21],[22]|
209
+
|[`STR`]|[`CAST`][10]|`STR` is not [`ANSI`], extremly slow, don't use more than 15 digits, and has rounding problem - use `CAST` plus concatenate instead `STR`|[23]|
210
+
|[`ISNUMERIC`]|[`TRY_CONVERT`]|`ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. |[24]|
211
+
|[`GETDATE`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
212
+
|[`GETUTCDATE`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
213
+
|[`SYSDATETIME`]|[`SYSUTCDATETIME`]| Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. |[25]|
214
+
|[`CURRENT_TIMESTAMP`]|[`SYSUTCDATETIME`]| It's too similar to the poorly-named TIMESTAMP data type, which has nothing to do with dates and times and should be called ROWVERSION. |[26]|
215
+
|[`DATETIMEFROMPARTS`]|[`DATETIME2FROMPARTS`]| It's too similar to the poorly-named TIMESTAMP data type, which has nothing to do with dates and times and should be called ROWVERSION. |[26]|
216
+
|[`ISDATE`]|[`TRY_CONVERT`]|`ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. |[26]|
217
+
|[`BETWEEN`]|`>=` and `<=`| Always use an open-ended range to prevent erroneously including or excluding rows. It's much less complex to find the beginning of the next period than the end of the current period. |[27]|
0 commit comments