问题
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