SSIS Expression w/ imbedded DOUBLE QUOTES not passing syntax check

  • I'm using an expression in my SSIS pkg to reference my EXCEL 20007 input data source. When I attempt to evaluate the expression I receive an error --- attributed to the nest DOUBLE QUOTES around the ---> Properties="Excel 12.0;HDR=YES";

    These double quotes are required. Any Ideas as to how to get this expression to successfully evaluate?

    @[User::Excel2007Files] + "\\XLS_Test_Type_T.xlsx;Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties="Excel 12.0;HDR=YES";"

    thx in advance...

    BT
  • Solution: http://sqlblog.com/blogs/andy_leonard/archive/2007/07/22/ssis-design-pattern-dynamic-sql.aspx

    SSIS Expressions Using nest Double Quotes

    The best way I've found to do this is to write the query as I'd like it to appear, then copy it and paste it into notepad. I then replace all the quotation marks (") with slash and quotation marks (\"). (EXCEPT for the FIRST & LAST Quotation Marks)

    If you then copy this and paste it into the expression builder, you merely need to nest it inside opening and closing quotation marks.

    EXAMPLE:

    This:

    @[User::Excel2007Files] + "\\XLS_Test_Type_T.xlsx;Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties="Excel 12.0;HDR=YES";"

    WOULD BE CHANGED to THIS:

    @[User::Excel2007Files] + "\\XLS_Test_Type_T.xlsx;Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=\"Excel 12.0;HDR=YES\";"

    BT
  • Hello,

    I had the exact same requirements of embedding " " for C:\Program Files in expression builder in SSIS.

    I implemented the above solution and it worked like a charm.

    Thanks,

    Amol

    Amol Naik

  • Me, too!! I had to put double-quotes around the path inside a variable for a winzip process. Worked beautifully!!

    Here's the code that fills in the argument for winzip:

    "-e -o \"" + @[User::ZipFileName1] +"\""

    😛

    Carl Ranquist


    Carl Ranquist
    Data Services Manager
    MTD Marketing, Inc.

  • Thanks for the post...this saved me hours...

  • Thanks! really helped, simple enough ,just place "\" before " to use in SSIS expressions.

  • Thanks!!!

    exactly what I was looking for.

  • Thanks! That was a quick easy solution. I love this site.

Viewing 8 posts - 1 through 7 (of 7 total)

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