sqlquery in R does not return all rows from query

末鹿安然 提交于 2019-12-22 07:24:10

问题


I am executing below commands in R:

dbhandle <- odbcDriverConnect('driver={SQL Server};server=serveripaddress;database=DBName;uid=sa;pwd=pwd;')

FactActivity <- sqlQuery(dbhandle, "SELECT DimCourseID,DimPatientID FROM DWH.FactActivity", as.is=TRUE)

nrow(FactActivity)

In my database I have total 238634 rows but in R I am getting total rows = 237652.

This is happening for all tables (I tried it for three tables).

Any idea what am I missing which is reducing no of rows in my resultset in R?


回答1:


I had the same problem, couldn't solve it, eventually switched to using RJDBC with a Java driver to get around it.



来源:https://stackoverflow.com/questions/43200384/sqlquery-in-r-does-not-return-all-rows-from-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!