![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Under SQL 2000 I have a table that consists of a single column of text type, each record holds about 15-25,000 chars. This data happens to be an xml, and I want to write this records to a text file. In order to accomplish this i'm using ISQL.exe, but i'm finding that some of the text type records aren't being written complete (truncated at 8k chars). |
#3
| |||
| |||
|
|
Any particular reason you are using ISQL? You may have better luck with OSQL. Or maybe even better luck with BCP. |
#4
| |||
| |||
|
|
BCP seems the way to go as it's not truncating the output and writes without a prob upto 100k chars per line (tested). Now, something that surfaced after some testing to implement BCP usage, is that BCP only writes to text file the very first "select" statement of the several that conform my stored procedure, will need to find a workaround. |
#5
| |||
| |||
|
|
Rod (rod.pe... (AT) gmail (DOT) com) writes: BCP seems the way to go as it's not truncating the output and writes without a prob upto 100k chars per line (tested). Now, something that surfaced after some testing to implement BCP usage, is that BCP only writes to text file the very first "select" statement of the several that conform my stored procedure, will need to find a workaround. In your original post you only talk about a table with the data type text. Suddently there are stored procedures. Do these procedures use FOR XML? Or do they select from text column that just happens to hold XML. |
#6
| |||
| |||
|
|
The text data is being generated on-the-fly using FOR XML by running several Select statements in series (some headers and elements are also sent to output). All these was compiled into a Stored Procedure for modularity. At first we were inserting each FOR XML to a table (SQL2k5) only to find the solution won't run under SQL 2000, so we rolled back to find a single solution compatible with SQL Server 2k & 2k5. After asking on usenet, and being suggested to use BCP, we now get a text-file including the output (w/o truncation) from the very first Select statement inside the SP while the other Select statements are ignored or not included in the text-file generated by BCP. |
![]() |
| Thread Tools | |
| Display Modes | |
| |