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
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
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
and data in table
now when run below r sqlcopytable command, there no error.
with verbose , error info
the command sqlcopytable(sqlconnect,"dbo.customer1","dbo.customer2")
but target table not have data.
i totally confused command. why still command not working?
Comments
Post a Comment