Thursday, June 9, 2016

About-R_DataTypeConversionToSqlServer

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 typeR classType in RESULT SETComments
smalldatetimePOSIXctdatetimeRepresented as GMT
smallmoneynumericfloat
datetimePOSIXctdatetimeRepresented as GMT
moneynumericfloat
uniqueidentifiercharactervarchar(max)
numeric(p,s)numericfloat
decimal(p,s)numericfloat
datePOSIXctdatetimeRepresented as GMT
tinyintintegerint
bitlogicalbit
smallintintegerint
intintegerint
floatnumericfloat
realnumericfloat
bigintnumericfloat
binary(n)

n <= 8000
rawvarbinary(max)Only allowed as input parameter and output
char(n)

n <= 8000
charactervarchar(max)
varbinary(n)

n <= 8000
rawvarbinary(max)Only allowed as input parameter and output
varchar(n)

n <= 8000
charactervarchar(max)
varbinary(max)rawvarbinary(max)Only allowed as input parameter and output
https://msdn.microsoft.com/en-us/library/mt590948.aspx

No comments:

HTMLCode

HTMLCode Content