It seems to work with SQLite but the use of row_number in distinct(.keep_all=TRUE) isn't quite right for MS SQL Server
library(dplyr)
library(dbplyr)
### need to setup your own SQL Server connection
con <- DBI::dbConnect(odbc::odbc)
copy_to(con, mtcars)
mtcars2 <- tbl(con, "mtcars")
### distinct works as expected
mtcars2 %>% distinct()
### gives error "The function 'ROW_NUMBER' must have an OVER clause with ORDER BY"
mtcars2 %>% distinct(carb, .keep_all = TRUE)
It seems to work with SQLite but the use of row_number in
distinct(.keep_all=TRUE)isn't quite right for MS SQL Server