Click here to Skip to main content
11,806,026 members (54,706 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL
Is there a maximum length (limit) for a SQL statement?

I Tried to Execute a Query as follows

INSERT INTO (name,description) VALUES('xxxx','description text')

here i have given the description text having character of 2000000.

While executing the SQL statement via my C# code is Throws an Exception "SystemOutofMemory".

Can anyone help me or Explain me what could be the cast of it please.

and the description column is VARCHAR(MAX) allows NULL.

Thanks in Advance.
Posted 22-Jan-13 20:40pm
Sergey Alexandrovich Kryukov at 23-Jan-13 2:44am
What makes you think that this is related to the limitation of the statement size? It seems to be totally illogical. This is not a bottleneck.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is, as always, implementation-dependent. Use manufacturer documentation; this information may or may not be available. I cannot imaging that it could be a bottleneck, so I won't be surprised if you could not find it.

Peter Felix A at 24-Jan-13 2:39am
I Written a Sql statement containing 168034 lines in it when i try to execute it says "System out of Memory Exception" Cannot Execute script.

What can be the cause of it then?
Sergey Alexandrovich Kryukov at 24-Jan-13 2:46am
I see, but may be these lines is not the immediate reason for it. It could be parsed successfully, but further processing may deplete memory. I think you are digging in wrong direction...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Richard Deeming 225
1 OriginalGriff 215
2 Sergey Alexandrovich Kryukov 170
3 ppolymorphe 125
4 Abhinav S 118
0 OriginalGriff 3,300
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100