Re: ISQL is truncating contents of text field sent to text file.
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 10 Jul 2007 21:40:32 +0000 (UTC)
Rod (rod.perez@xxxxxxxxx) writes:
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.
I would suggest that you are best off writing a client program that
receives the XML documents and writes them to file.
The alternative would be have one procedure per query and the have have a
command file that runs BCP once for each procedure, and at the end
concatenates the files into one with COPY. But I am a little wary
that BCP + FOR XML may not be something when always works. When first
asked, you only talked about a table column, why BCP appear to be a good
solution.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- ISQL is truncating contents of text field sent to text file.
- From: Rod
- Re: ISQL is truncating contents of text field sent to text file.
- From: Erland Sommarskog
- Re: ISQL is truncating contents of text field sent to text file.
- From: Rod
- Re: ISQL is truncating contents of text field sent to text file.
- From: Erland Sommarskog
- Re: ISQL is truncating contents of text field sent to text file.
- From: Rod
- ISQL is truncating contents of text field sent to text file.
- Prev by Date: Re: insert loop -- I'm missing the obvious
- Next by Date: Re: insert loop -- I'm missing the obvious
- Previous by thread: Re: ISQL is truncating contents of text field sent to text file.
- Next by thread: Trigger ed on delete...
- Index(es):
Relevant Pages
|