RODBC - sqlSave - 追加操作崩溃R.

时间:2016-08-25 15:18:13

标签: r rodbc

我正在尝试将以下数据框保存到SQL Server 2014表:

Observations: 1
Variables: 4
$ ValidationDate <chr> "2016-08-23"
$ DataType       <chr> "Panel"
$ MissingData    <chr> "{\"SubId\":[160823030720,160823030721,160823030722,160823030723,16082303072...
$ Comments       <chr> "Missing in ODS"

我正在执行以下R代码:

sqlSave(odsHandle,df,tablename =“Utility.DailyDataValidation”,append = T)

执行此行时,暂停可能持续15秒,然后R崩溃并出现以下错误:

enter image description here

1 个答案:

答案 0 :(得分:1)

带有sqlSave

append=TRUE经常无法正常工作,所以您经常需要编写自己的插入语句

sqlQuery(odsHandle,paste0("insert into Utility.Daily.Data.Validation values (",*paste values here separated by a comma*,")")