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
# Data type mappings between Python and SQL Server
14
14
[!INCLUDE [SQL Server 2017 and later](../../includes/applies-to-version/sqlserver2017.md)]
15
15
16
-
For Python solutions that run on the Python integration feature in SQL Server Machine Learning Services, review the list of unsupported data types, and data type conversions that might be performed implicitly when data is passed between Python and SQL Server.
16
+
This article lists the supported data types, and the data type conversions performed, when using the Python integration feature in SQL Server Machine Learning Services.
17
17
18
-
## Python Version
19
-
20
-
A subset of the RevoScaleR functionality (rxLinMod, rxLogit, rxPredict, rxDTrees, rxBTrees, maybe a few others) is provided using Python APIs, using a new Python package **revoscalepy**. You can use this package to work with data using Pandas data frames, XDF files, or SQL data queries.
21
-
22
-
For more information, see [revoscalepy module in SQL Server](ref-py-revoscalepy.md) and [revoscalepy function reference](https://docs.microsoft.com/machine-learning-server/python-reference/revoscalepy/revoscalepy-package).
23
-
24
-
Python supports a limited number of data types in comparison to SQL Server. As a result, whenever you use data from SQL Server in Python scripts, data might be implicitly converted to a compatible data type. However, often an exact conversion cannot be performed automatically, and an error is returned.
18
+
Python supports a limited number of data types in comparison to SQL Server. As a result, whenever you use data from SQL Server in Python scripts, SQL data might be implicitly converted to a compatible Python data type. However, often an exact conversion cannot be performed automatically and an error is returned.
25
19
26
20
## Python and SQL Data Types
27
21
28
22
This table lists the implicit conversions that are provided. Other data types are not supported.
|**datetime**|`datetime`|Supported with SQL Server 2017 CU6 and above (with **NumPy** arrays of type `datetime.datetime` or **Pandas**`pandas.Timestamp`). `sp_execute_external_script` now supports `datetime` types with fractional seconds.|
|**datetime**|`datetime`| Supported with SQL Server 2017 CU6 and above (with **NumPy** arrays of type `datetime.datetime` or **Pandas**`pandas.Timestamp`). `sp_execute_external_script` now supports `datetime` types with fractional seconds.|
32
+
|**float**|`float64`|
33
+
|**nchar**|`str`|
34
+
|**nvarchar**|`str`|
35
+
|**nvarchar(max)**|`str`|
36
+
|**real**|`float64`|
37
+
|**smalldatetime**|`datetime`|
38
+
|**smallint**|`int32`|
39
+
|**tinyint**|`int32`|
40
+
|**uniqueidentifier**|`str`|
41
+
|**varbinary**|`bytes`|
42
+
|**varbinary(max)**|`bytes`|
43
+
|**varchar(n)**|`str`|
44
+
|**varchar(max)**|`str`|
45
+
46
+
## See also
47
+
48
+
+[Data type mappings between R and SQL Server](../r/r-libraries-and-data-types.md)
0 commit comments