I have searched quite a bit and read the package documentation, but can't find a solution for this.
I'm using RODBC 1.3-12 against Microsoft SQL Server with the below details.
DBMS_Name "Microsoft SQL Server"
DBMS_Ver "10.50.6220"
Driver_ODBC_Ver "03.52"
Driver_Name "SQLSRV32.DLL"
Driver_Ver "06.01.7601"
ODBC_Ver "03.80.0000"
I'm not sure how to give a reproducable example, since you'd need a DB, but below is code similar to what I'm using.
myConnection<- odbcDriverConnect(connection = "Driver={SQL Server};server=myServerName;database=myDBName;trusted_connection=yes")
myDataFrame <- sqlQuery(myConnection, "select top 100 * from myTable", as.is=TRUE)
Per the documentation, doubles are coming back as numeric, as I'd expect, but float and money come back as character.
Is anyone aware of a way around this?
DECIMAL
in your SQL expression, or cast them tonumeric
within R? – Pancreatotomy