6

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
  • 1
    ? nrow(FactActivity) Commented Apr 4, 2017 at 7:17

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Yes it did. Would recommend this approach, since it also doesn't depend on local resources of the operating systems - it is portable across platforms (assuming you have access to a Java installation).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.