Skip to content
IntoSQL home

Data types

SQL Server data types between versions

Every SQL Server data type an older or newer SQL Server stores differently, what the converter writes for it, and the report line.

View as Markdown

Each row is a type from SQL Server that an older or newer SQL Server stores differently: what the script gets, why, and the line the report writes about it. The rows come from the converter's own rules, so this page matches what it does.

Convert in the browser: SQL Server to SQL Server opens the converter set up for this pair. The SQL Server to SQL Server migration guide covers dumping, loading and the rules for keys, indexes and names.

A report line is a fix when the converter changed something and lists it, or a problem when a value or object is worth a look.

Numbers

In the dump In the script Why Report line
decimal(p,s), money, smallmoney decimal(p,s); money as decimal(19,4) Every digit is kept, money with its four decimals. None

Booleans and bits

In the dump In the script Why Report line
bit bit The same type. None

Text

In the dump In the script Why Report line
char(n), varchar(n), nchar(n), nvarchar(n), varchar(max), text, ntext nchar(n), nvarchar(n) and nvarchar(max), with each column's collation nvarchar holds every character, whatever the code page of a varchar column was. UTF-8 collations, which SQL Server 2017 lacks, become their Unicode twin. None
NUL characters in text kept nvarchar can hold a NUL character, so the value is copied as it is. None
text that isn't valid in its encoding the bad bytes as the replacement character The script is UTF-8 and every value has to be valid text. invalid_utf8_replaced (problem)

Dates and times

In the dump In the script Why Report line
datetime, datetime2, smalldatetime datetime2(p) datetime2 holds every datetime and smalldatetime value, from the year 1, with the same precision. None
datetimeoffset datetimeoffset, with each value's offset The same type and values. None
time time(p) The same type. None
dates that aren't valid NULL A value that isn't a date becomes NULL and the report counts it. date_out_of_range (problem)

Binary

In the dump In the script Why Report line
binary, varbinary, image binary(n), varbinary(n) and varbinary(max) Bytes stay bytes. None
rowversion, timestamp binary(8), empty A rowversion column can't take the copied rows, and SSMS scripts no values for it; add it again after loading if you need one. rowversion_empty (fix)

JSON, spatial and other types

In the dump In the script Why Report line
json (SQL Server 2025) nvarchar(max) The same JSON values, which SQL Server's JSON functions read. None
uniqueidentifier uniqueidentifier The same type. None
xml, sql_variant, hierarchyid, geometry, geography the same types SQL Server's own types are kept; sql_variant values keep their text, so their base type becomes nvarchar. None
types IntoSQL doesn't know nvarchar(max) Text holds any value; change the type after loading. unknown_type (problem)

Counters and identities

In the dump In the script Why Report line
IDENTITY IDENTITY, continuing after the highest id The copied ids load with IDENTITY_INSERT, and the counter continues after the highest one. None

Other pairs