SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Expression w/ imbedded DOUBLE QUOTES not passing syntax check


SSIS Expression w/ imbedded DOUBLE QUOTES not passing syntax check

Author
Message
Express12
Express12
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1466 Visits: 1058
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
Express12
Express12
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1466 Visits: 1058
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
AmolNaik
AmolNaik
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1119 Visits: 1234
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
Carl Ranquist
Carl Ranquist
SSC-Enthusiastic
SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)

Group: General Forum Members
Points: 165 Visits: 11
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] +"\""

:-P

Carl Ranquist


Carl Ranquist
Data Services Manager
MTD Marketing, Inc.
sidneykeizer
sidneykeizer
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 16
Thanks for the post...this saved me hours...
mirzafahad1409
mirzafahad1409
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 23
Thanks! really helped, simple enough ,just place "\" before " to use in SSIS expressions.
hetavdave
hetavdave
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 28
Thanks!!!
exactly what I was looking for.
shelleybobelly
shelleybobelly
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 764
Thanks! That was a quick easy solution. I love this site.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search