R - sqlCopyTable() in RODBC error -


i new r language. trying out examples. when tried sqlcopytable command, encountering error, have described below.

i have below src_customer table in sql server 2014,

+---------------+---------------+---------------+-------------------+-------------------+---------------+-----------+---------------+-----------+---------------+---------------+ |   customerid  |   companyname |   contactname |   contacttitle    |   address         |   city        |   region  |   postalcode  |   country |   phone       |   fax         | +---------------+---------------+---------------+-------------------+-------------------+---------------+-----------+---------------+-----------+---------------+---------------+ |   alfki       |  alfreds futt |  maria anders |   sales rep       |   obere str. 57   |   berlin_new  |   null    |   12209       |   germany |   030-0074325 |   030-0076545 | |   anatr       |  ana trujillo |  ana trujillo |   owner           |   constitución    |   méxico d.f. |   null    |   5021        |   mexico  |   (5)555-4729 |   (5)555-3745 | |   anton       |  antonio      |  antonio      |   owner           |   mataderos  2312 |   méxico d.f. |   null    |   5023        |   mexico  |   (5)555-3932 |   null        | |   arout       |  around horn  |  thomas hardy |   sales rep       |   120 hanover sq. |   london      |   null    |   wa1 1dp     |   uk      |   (5)555-3923 |   (5)555-3923 | +---------------+---------------+---------------+-------------------+-------------------+---------------+-----------+---------------+-----------+---------------+---------------+ 

and table structure

enter image description here

now when try copy table data table target_customer in same database has same structure src_customer table, getting error.

below command have used

sqlcopytable(sqlconnect,srctable = "src_customer", desttable = "target_customer")

i getting below error

enter image description here

there null values in table, tried updating columns value , ran same above query. still getting same error.

i tried sqlcopy below

sqlcopy(sqlconnect,"select * vignesh.dbo.src_customer;", "target_customer")

sqlcopy worked perfectly.

what issue sqlcopytable command?

update per @errantbard suggestion in comments.

i have created table single table below

enter image description here

and data in table

enter image description here

now when run below r sqlcopytable command, there no error.

enter image description here

with verbose , error info

enter image description here

the command sqlcopytable(sqlconnect,"dbo.customer1","dbo.customer2")

but target table not have data.

enter image description here

i totally confused command. why still command not working?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -