Embedded SQL statements executed if too many mistakes?

Category: Delphi -> Database Author: kktzz Date: 2008-09-30 14:56:32
 
kktzz
2008-09-30 14:56:32
Even in the Delphi program Ms SQLServer, the program generated dynamically insert statement of n (n sometimes thousands), when calling Query control to perform ExecSQL, and when n is greater than 2XXX, it will report a syntax error, but in fact those dynamic generate the sql syntax is not a problem, I ask in the end what is the problem?
tangbbb
2008-09-30 15:07:38
Pay attention to your SQL statements in a row there is a problem, not a Query's Bug.
suggest you pass string output, the SQL statement is executed, copied to the Query Analyzer execution.
shenzhenqinzhan
2008-09-30 15:18:38
Solution: with a transaction executed separately!
lyabcd88
2008-09-30 15:35:37
Can the error publish it?

Hey, do not handle error?
zhshj123
2008-09-30 15:43:44
possible.
query the text length is limited. If that is 2048
naiqing1123
2008-09-30 16:00:48
You can use multiple query it
rainybin521
2008-09-30 16:04:40
query the text length is limited. If that is 2048
=========================================
Query the text for the string type, its up to 2GB
zhang7409
2008-09-30 16:12:18
"pay attention to your SQL statements in a row there is a problem, not a Query's Bug.
suggest you pass string output , the SQL statement is executed, copied to the Query Analyzer to perform. "
============================== ================================================== =
I reduce the dynamic generated statements in a certain range, it will not make mistakes or errors that a statement is no longer, how to explain? Copied into Query Analyzer execution should be no problem, because each statement generated by the program, are shaped like "insert tablename ('XXXX')" statement, there is a syntax error problem.

I'm not flat, can not say the specific error, but I guess the reason is that the query inside the sql statement has length limitations, because sql server error is reported out syntax errors, and "error" of a "inse" is truncated second half of the.