rsqlserver
rsqlserver copied to clipboard
Passing connection string between R and .NET is failing
Connection strings such as
-
server\instance
-
(localdb)\v11.0
-
domain\username
are all valid for SQL Server however R requires that \
are escaped and .NET does not.
eg.
dbConnect("SqlServer", url = "Server=(local)\\SQL2014;...")
is a valid connection string in R.
This breaks when connections are passed as raw strings to .NET through SqlBulkWrite
and SqlBulkCopy
instead of connection objects.
Possible fix is to simply strip escaped backslashes prior to passing the connection string to .NET in dbBulkCopy
and dbBulkWrite
.