The following table shows the changes in data types and values when data from SQL Server is used in an R script and then returned to SQL Server.
| SQL Server type | R class | Type in RESULT SET | Comments |
| smalldatetime | POSIXct | datetime | Represented as GMT |
| smallmoney | numeric | float | |
| datetime | POSIXct | datetime | Represented as GMT |
| money | numeric | float | |
| uniqueidentifier | character | varchar(max) | |
| numeric(p,s) | numeric | float | |
| decimal(p,s) | numeric | float | |
| date | POSIXct | datetime | Represented as GMT |
| tinyint | integer | int | |
| bit | logical | bit | |
| smallint | integer | int | |
| int | integer | int | |
| float | numeric | float | |
| real | numeric | float | |
| bigint | numeric | float | |
| binary(n) n <= 8000 | raw | varbinary(max) | Only allowed as input parameter and output |
| char(n) n <= 8000 | character | varchar(max) | |
| varbinary(n) n <= 8000 | raw | varbinary(max) | Only allowed as input parameter and output |
| varchar(n) n <= 8000 | character | varchar(max) | |
| varbinary(max) | raw | varbinary(max) | Only allowed as input parameter and output |
No comments:
Post a Comment