Click here to Skip to main content
13,597,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
Is there a maximum length (limit) for a SQL statement?

I Tried to Execute a Query as follows

INSERT INTO <sample table=""> (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
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 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?
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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02-2016 | 2.8.180621.3 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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