Inserting multiple queries in sql server 2005 using RODBC in R

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inserting multiple queries in sql server 2005 using RODBC in R

vikrant
I am trying to insert multiple insert statements through R using RODBC. Initially Every time I am creating Insert statements and executing queries one by one.This takes lot of time since everytime the query is created and inserted. Is there any other way So that I can insert Multiple Insert statements in a single execution. I have tried Option for sqlSave, But in the parameters databasename is not mentioned. So it is trying to create table in a master database. But I need to create table and insert statement in mydatabase and table. How is it possible ?
Reply | Threaded
Open this post in threaded view
|

Re: Inserting multiple queries in sql server 2005 using RODBC in R

Dieter Menne
Reply | Threaded
Open this post in threaded view
|

Re: Inserting multiple queries in sql server 2005 using RODBC in R

Dieter Menne
In reply to this post by vikrant
vikrant wrote
I am trying to insert multiple insert statements through R using RODBC. Initially Every time I am creating Insert statements and executing queries one by one.This takes lot of time since everytime the query is created and inserted. Is there any other way So that I can insert Multiple Insert statements in a single execution. I have tried Option for sqlSave, But in the parameters databasename is not mentioned. So it is trying to create table in a master database. But I need to create table and insert statement in mydatabase and table. How is it possible ?
sqlSave with FAST=TRUE should do this. The problem that "the databasename is not mentioned" is valid for all operations, because you should assign the database name in odbcConnect. So if you copy from one database to the other, open two channels.

Dieter