I'm trying to write data to a table in SQL Server using dbWriteTable
from odbc
package. And, getting this error:
dbWriteTable(con1, 'mtcars', mtcars[1:5, ])
Error: 'CREATE TABLE "mtcars" ( "row_names" varchar(255), "mpg" FLOAT, "cyl" "disp" FLOAT, "hp" FLOAT, "drat" FLOAT, "wt" FLOAT, "qsec" FLOAT, "vs" FLOAT, "am" FLOAT, "gear" FLOAT, "carb" FLOAT)' nanodbc/nanodbc.cpp:1587: 42000: [FreeTDS][SQL Server]Incorrect syntax near 'mtcars'.
It's working fine from a windows machine. Any help would be appreciated..