5
Friends, I consumed a web service with R and now I need to export this data directly to sql server. How do I?
5
Friends, I consumed a web service with R and now I need to export this data directly to sql server. How do I?
1
One of the ways you can do this is by using the RODBC package.
library(RODBC)
# Use a função odbcDriverConnect para criar uma conexão com o banco
dbhandle=odbcDriverConnect("driver={SQL Server};
server='your_servername';
database='your_database';
uid='your_user';
pwd='your_password'")
# Use a função sqlSave para salvar um data.frame em uma tabela especifica na
# conexão criada.
sqlSave(dbhandle,'your_data_frame','you_table_name')
# Se você ainda quiser realizar a leitura de dados das tabelas disponíveis
# no banco, use a função sqlQuery para executar uma Query.
df=sqlQuery(dbhandle,paste("SELECT * from 'your_table'"))
Browser other questions tagged sql-server r export
You are not signed in. Login or sign up in order to post.
Have you looked at this package? https://cran.r-project.org/web/packages/RSQLServer/index.html
– Daniel Ikenaga
@Clecionepunuceno: Which version of SQL Server?
– José Diz
@Josédiz , I use SQL server 2014
– Clecio Nepunuceno
@Clecionepunuceno how so export? Vc want to popular tables in a SQL Server database using these data consumed?
– Artur_Indio