[R] Help: sqlSave Error
Jeff Newmiller
jdnewmil at dcn.davis.ca.us
Thu Nov 10 18:20:06 CET 2011
The error seems clear enough to me... sqlSave is trying to create the table but it already exists.
Some possible directions you could take:
1) Do your work on a particular instance of the table within a single transaction and rollback at the end.
2) Delete the table before you run sqlSave.
3) Explicitly create the table once and keep it, deleting data before re-using it, and use the append option.
4) Include a column that distinguishes between different blocks of data and keep all of the data you add to it.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
bruclee <brouce33 at gmail.com> wrote:
>I am using sqlSave to save my data into an existing table at MS SQL
>Server
>database. Previously my code ran smoothly but all of a sudden it
>stopped
>working. Here is my code:
>
>sqlSave(con, highVol, "dbo.futuresHighVol", append=TRUE,
>rownames=FALSE)
>
>Error: sqlSave(con, highVol, "jrgchis.dbo.futuresHighVol", append =
>TRUE, :
> 42S01 2714 [Microsoft][ODBC SQL Server Driver][SQL Server]
>'futuresHighVol' already exist
>[RODBC] ERROR: Could not SQLExecDirect 'CREATE TABLE
>jrgchis.dbo.futuresHighVol ("TradeTime" varchar(255), "vol" float)'
>
>Please Help!!!
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/Help-sqlSave-Error-tp4022523p4022523.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list