Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

String Literal in the expression exceeds the maximum allowed length of 4000 characters. Expand / Collapse
Posted Thursday, September 6, 2012 12:51 AM


Group: General Forum Members
Last Login: Monday, September 17, 2012 2:33 AM
Points: 19, Visits: 91
Hi All,

I need a small help. In my ssis package, huge SQL statement is constructed through expressions

SQL is exceeding more than 4000 characters.

Could anyone please share the thoughts / work around to resolve the issue.

Thanks in advance.

Post #1355060
Posted Thursday, September 6, 2012 3:00 AM



Group: General Forum Members
Last Login: Today @ 12:24 AM
Points: 5,317, Visits: 12,355
1) Break down into multiple queries.

2) Use fewer characters.

3) Call a parameterised stored proc to do the work for you.

Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. (Mark Twain)
Post #1355135
Posted Thursday, September 13, 2012 1:01 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, July 28, 2014 12:04 PM
Points: 35, Visits: 98
Everything the fellow reponder (PP) said :

Break doen into smaller queries
Write short expressions(maybe even shorter variable names)

Parametreized stored proc

Might i also suggest :
Have a .sql file in which you write out your command and then have your ssis execute that instead.
A long winded way but will work.
Post #1358808
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse