rsqlserver icon indicating copy to clipboard operation
rsqlserver copied to clipboard

Passing connection string between R and .NET is failing

Open ruaridhw opened this issue 7 years ago • 0 comments

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.

ruaridhw avatar Feb 12 '18 17:02 ruaridhw