Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Comments
Sergey Alexandrovich Kryukov 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.
—SA

1 solution

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.

—SA
 
Share this answer
 
Comments
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?
Sergey Alexandrovich Kryukov 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...
—SA

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900