SSIS Double Backslash is causing connection issues

梦想的初衷 提交于 2019-12-08 13:36:54

问题


I'm currently using an Execute SQL Task to pull in dynamic information to build my connection string for each of my databases. From there I'm passing them to a Foreach Loop. At this point I'm building my connection string using an expression:

"Data Source="+ @[User::DatabaseServer]+ "\\"+@[User::Instance]+";User ID="+@[User::UserName]+ ";Password="+ @[User::Password] +";Initial Catalog=Defaul;Provider=SQLNCLI10.1;"

My issue is the following, when my connection string is built with a double backslash.

Data Source=DatabaseServer\\InstanceName;User ID=UserName;Password=Password;Initial Catalog=Default;Provider=SQLNCLI10.1;

Does anyone know how to prevent the double backslash from occurring? I've tried to use the escape characters but I have had 0 success.


回答1:


i found a work around of the issue  :


what I have done is :

I have taken the first parameter for connction string like : "anystaring
and the second parameter for the db is :  newdb"

so now check the screenshot I have given the URL(not able to upload the image sorry):

http://tinypic.com/view.php?pic=2v3oj6x&s=8#.VHQ8aSjrbcs



来源:https://stackoverflow.com/questions/26538143/ssis-double-backslash-is-causing-connection-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!