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


String Expression 4000 characters limit


String Expression 4000 characters limit

Author
Message
vasamsettipradeep
vasamsettipradeep
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 138
Hi all,

I have a query more than 4000 characters limit .I am setting with variables to the query.while i used the string expression i am getting error like string expression is limited to 4000 characters limit.Is any one have idea about how to eliminate the length limit in expression.
GSquared
GSquared
SSC Guru
SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)

Group: General Forum Members
Points: 58065 Visits: 9730
Replace the string expression with either a code object or a stored proceduring, depending on what you are trying to do with it.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Daniel Bowlin
Daniel Bowlin
SSCrazy Eights
SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)SSCrazy Eights (8K reputation)

Group: General Forum Members
Points: 8020 Visits: 2629
Fortunately the 4000 character limit is an expression limitation, not a limitation of the number of characters in the string.

I have not done this personally but you might be able to break your expression down into parts and set a variable to each section. For example Var1, Var2, Var3, SQLVar. Then
Var1 = SELECT........
Var2 = FROM.....
Var3 = WHERE....
SQLVar = Var1 + Var2 + Var3

If that doesn't work the other way is to pull the query as suggested above from SQL built as a stored procedure, or from a column in a table that stores the entire query, and then set your variable value to the string returned.
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