Click here to monitor SSC
SQLServerCentral is supported by Redgate
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 @ 5:40 PM
Points: 7,960, Visits: 19,064
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.

If your posting includes some T-SQL code, please surround the code with IFCode formatting tags. It helps readability a lot.
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: Thursday, May 26, 2016 10:31 AM
Points: 35, Visits: 122
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