Giter VIP home page Giter VIP logo

Comments (8)

hongooi73 avatar hongooi73 commented on July 1, 2024 1

There is also an example of how to connect on the repo's front page.

library(DBI)
con <- dbConnect(RSQLServer::SQLServer(), server = "TEST", database = 'DBItest')
dbWriteTable(con, "band_members", dplyr::band_members)
dbWriteTable(con, "band_instruments", dplyr::band_instruments)
# RSQLServer only returns tables with type TABLE and VIEW.
dbListTables(con)
#> [1] "band_instruments" "band_members"
dbReadTable(con, 'band_members')
#>   name    band
#> 1 Mick  Stones
#> 2 John Beatles
#> 3 Paul Beatles
dbListFields(con, 'band_instruments')
#> [1] "name"  "plays"

# Fetch all results
res <- dbSendQuery(con, "SELECT * FROM band_members WHERE band = 'Beatles'")
dbFetch(res)
#>   name    band
#> 1 John Beatles
#> 2 Paul Beatles
dbClearResult(res)
#> [1] TRUE

from rsqlserver.

hongooi73 avatar hongooi73 commented on July 1, 2024

What versions of dplyr and RSQLServer are you using?

from rsqlserver.

maybeth avatar maybeth commented on July 1, 2024

I am not sure. I am using 3.4.1 version for R. Please let me know how I can check the version of dplyr & RSQLServer. I just installed these today, using the commands
install.packages(‘devtools’)
install.packages("RSQLServer")

So I would think whatever version one gets by submitting those commands, are the versions I got. But I can check and get back to you if you let me know how to. I am new to R.

from rsqlserver.

maybeth avatar maybeth commented on July 1, 2024

Also, I used US OR as the mirror site

from rsqlserver.

imanuelcostigan avatar imanuelcostigan commented on July 1, 2024
packageVersion("RSQLServer")
packageVersion("dplyr")

from rsqlserver.

maybeth avatar maybeth commented on July 1, 2024

packageVersion("RSQLServer")
[1] ‘0.3.0’
packageVersion("dplyr")
[1] ‘0.7.1’

from rsqlserver.

imanuelcostigan avatar imanuelcostigan commented on July 1, 2024

This is expected (albeit undocumented in release notes - sorry). dplyr's mechanism for connecting to servers has changed with 0.7. Instead of

library(dplyr)
conn<-RSQLServer::src_sqlserver("servername”, database="database name or initial catalog")

You do the following

library(DBI)
library(dplyr)
dbi_conn<-dbConnect(RSQLServer::SQLServer(), ...) 

Then use dbi_conn wherever you would have used conn as per above.

from rsqlserver.

maybeth avatar maybeth commented on July 1, 2024

Thank you

from rsqlserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.