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
Author
Message
Posted Thursday, September 06, 2012 12:51 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

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

Problem:
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 06, 2012 3:00 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 4:25 AM
Points: 4,828, Visits: 11,184
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.
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, April 07, 2014 5:43 PM
Points: 35, Visits: 89
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