Variable adds an extra "\" to the folder path

  • Hi,

    I have a SP which returns the SourcePath depending on a particular input value.

    When I execute the SP in Management studio, it returns the proper value of "C:\MNMFiles\TEST"

    However, when I view the value of the variable in SSIS that this value gets attahced to,

    I get a "C:\\MNMFiles\\TEST"

    It was working fine about a month ago. I have reinstalled SQL 2008 R2 again using the same setup.exe as before. Thats the only thing which has changed in this time period.

    Any help would be appreciated. Is it something to do with the SSIS settings?

    Thanks.

  • The error was due to something else. However, when you view a variable the fact remains that it replicates the "\" , although that does not come in the way of proper execution.

    All works well now. 🙂

  • Awesome 🙂

  • namrata.dhanawade-1143388 (1/4/2011)


    The error was due to something else. However, when you view a variable the fact remains that it replicates the "\" , although that does not come in the way of proper execution.

    All works well now. 🙂

    That's because \ is a special character in SSIS. Therefore, when you want to place a \ in a string, you need to escape it with another \.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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