Java and SQL Server supported data types

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2019)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

This article maps SQL Server data types to Java data types for data structures and parameters on sp_execute_external_script.

Data types for data sets

The following SQL and Java data types are currently supported for Input and Output data sets.

SQL data type Java data type Comment
Bit boolean
Tinyint short
Smallint short
Int int
Real float
Bigint long
float double
nchar(n) String
nvarchar(n) String
binary(n) byte[]
varbinary(n) byte[]
nvarchar(max) String
varbinary(max) byte[]
uniqueidentifier String
char(n) String Only UTF8 Strings supported
varchar(n) String Only UTF8 Strings supported
varchar(max) String Only UTF8 Strings supported

Data types for input parameters

The following SQL and Java data types are currently supported for input parameters.

SQL data type Java data type Comment
Bit boolean
Tinyint short
Smallint short
Int int
Real float
Bigint long
float double
nchar(n) String
nvarchar(n) String
binary(n) byte[]
varbinary(n) byte[]
nvarchar(max) String
varbinary(max) byte[]
uniqueidentifier String
char(n) String Only UTF8 Strings supported
varchar(n) String Only UTF8 Strings supported
varchar(max) String Only UTF8 Strings supported

Data types for outut parameters

The following SQL and Java data types are currently supported for output parameters.

SQL data type Java data type Comment
Bit boolean
Tinyint short
Smallint short
Int int
Real float
Bigint long
float double
uniqueidentifier String

Next steps