October 19, 2004 at 7:17 am
While attempting to insert a large amount of data into a text field received
the following error: Internal Query Processor Error: The query processor ran
out of stack space during query optimization.
The data being inserted contains several Char(10) values imbedded for
formatting. If the Char(10) values are removed, the record inserts fine.
I have tried increasing the amount of query memory, but that did not resolve
the issue.
The text is being inserted into an ntext field and is comprised of about 18K characters spread across
400 distinct lines (thus the carriage controls). The insert command basically looks
like this:
insert into TABLE1 (TABLE1ID,TABLE1Description)
values ('401428','message part 1'+CHAR(10)+'message part 2
'+CHAR(10)+'message part 3 '+CHAR(10)+'message part 4'+CHAR(10)+...
The insert statement is built in code and passed directly to SQL. The text needs
to retain its format, that's why all the carriage controls are in place.
I'm a little perplexed as to why the carriage control would cause the stack issue and
looking for ways to resolve the stack space issue without having to change the applications
that generate the sql.
October 19, 2004 at 7:41 am
All sorts of funny things can hapen when you introduce control charachters in the data. imo they don't belong there, tables are for data, not layout.
Anway, if you really need some kind of rowseparation, and this doesn't work, perhaps you could insert 400 rows and a rownumber instead...? Or, switch out the char(10) for some other 'normal' delimiter char, and then have the displaying client replace that char(s) with char(10) upon selecting it.. (could perhaps also be done in a view, or a proc designed for retrieval of the data)
/Kenneth
October 19, 2004 at 11:57 am
Have you tried letting the client put in the line breaks, as in:
INSERT INTO T VALUES ( 'a', 'line 1
line 2
line 3
line 4' )
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply