using a variable to specify the destination database files in the transfer database task editor

  • Here is what I am trying to use:

    "'" + @[User::ShowDestData] + "','F:\\SQL Databases','';" + @[User::ShowDestLog] + "'D:\\SQL LogFiles',''"

    But it seems to want to force that i use double quotes instead of single quotes and I cannot figure out hot to insert a single quotes into the expression value... I've tried """ but it dosent work.

    Any ideas...

  • Inside the double quotes you can mention single quote. the expression language uses C#. all strings are considered as double quotes so u have to start the expression with double quote if the value is constant

  • I'm not understanding that at all.

  • figured out how to get the string formatted the way I want, but still did not work.

    Anyone have an idea how to solve this problem:

    need to copy a database using a dynamic value as the new database name (along with filepath).

    thanks

  • Your single quotes don't match, and I'm not sure whether single quotes would work anyway.

    You need to use double quotes.  To use them in an expression you must escape them with \, using two of them in a row doesn't work.

    I think your expression should be:

    "\"" + @[User::ShowDestData] + "\",\"F

    :\\SQL Databases\",\"\";\"" + @[User::ShowDestLog] + "\",D:\\SQL LogFiles\",\"\""

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply