Deterministic — straight from Microsoft's own precedence table

Data type precedence checker

When T-SQL compares, joins, or combines two different data types, the lower-precedence one gets implicitly converted to match the higher-precedence one — regardless of which side of the expression it's on. Pick two types below to see which one wins.

nvarcharwinsvarchargets converted

Precedence rank 26 beats rank 28 (1 = highest). Every varchar value involved in this comparison is implicitly converted to nvarchar before the comparison runs.

If one of these is a column with an index on it, this conversion is the classic index-killer — the column gets wrapped in an implicit CONVERT, which usually turns a seek into a scan. Full explanation.

Why this matters more than it looks

This isn't just trivia — it's the mechanism behind one of the most common real-world T-SQL performance bugs. If a column is the lower-precedence side of a comparison, SQL Server converts the column's values (not the other side), which usually makes an index on that column unusable — a seek silently becomes a scan, with no error to flag it. The single most common trigger: ADO.NET and most ORMs default a plain string parameter to NVARCHAR, so comparing it against a VARCHAR column hits this on every call. Full explanation, with the exact plan predicate to look for →

The full precedence order

Highest to lowest. Length/precision (varchar(50) vs varchar(200)) never affects this — only the base type does.

  1. 1json
  2. 2sql_variant
  3. 3xml
  4. 4user-defined type
  5. 5datetimeoffset
  6. 6datetime2
  7. 7datetime
  8. 8smalldatetime
  9. 9date
  10. 10time
  11. 11float
  12. 12real
  13. 13decimal
  14. 14money
  15. 15smallmoney
  16. 16bigint
  17. 17int
  18. 18smallint
  19. 19tinyint
  20. 20bit
  21. 21ntext
  22. 22text
  23. 23image
  24. 24timestamp
  25. 25uniqueidentifier
  26. 26nvarchar
  27. 27nchar
  28. 28varchar
  29. 29char
  30. 30vector
  31. 31varbinary
  32. 32binary

hierarchyid</code>, <code>geometry</code>, <code>geography all rank above the string and binary types above, but Microsoft doesn't publish their exact position relative to the numeric/date types or to each other.

Source: Microsoft's Data Type Precedence documentation. This list reflects the current published order — Microsoft has changed it before (adding json and vector), so re-check against the source if this page is old.