Re: more than 8192 characters in text file output

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Erland. That's a much bigger limit and is sufficient for what I'm
doing. I hadn't tried that because when you save output as a file from
results that are "export as grid" you can't choose the delimiter (AFAIK).
That has caused problems for me in the past. But since this is a single
column output, the delimiter doesn't matter. Anyway, I'm wondering how this
would be done if even the grid limit is too small. For example, a TEXT type
column can hold far more than 65535 bytes. Would you have to do what I
suggested in the 2nd part of my post?


"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message
news:Xns9CE45FF57F08BYazorman@xxxxxxxxxxxx
Keith G Hicks (krh@xxxxxxxxxxx) writes:
I have a customer that is requiring me to generate INSERT statements (in
a tab delimted text file) for him from their existing MSSQL 2005 table
for import into an outside MySql system for other purposes. I'm creating
the statements for about 10 columns, one of which is TEXT type. Most of
the rows contain less than 4000 characters of text in that column but a
few exceed that by quite a bit. I've written a query to generate the
INSERTS and it runs fine except that we discovered that some lines in
the output are being truncated at 8192 characters. I went into Options
-> Query Results -> SQL Server -> Results to Text and found that 8192 is
the limit. How can I get this to give me my full set of data for this?

Try to set output to file. Using SQLCMD may also be an alternative. Or
simply use output to grid which has a higher limit.





--
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


.



Relevant Pages

  • Re: Syntax coloring: SERVICE
    ... If so, Erland, it is only because I have failed in my attempts to ... any version of Outlook. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: stored procedure question
    ... Erland, ... regarding computing and large insert be done directly in the database. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Simplest CLR
    ... Erland, or Santa Claus will put a lump of carbon credits in your stocking:) ... provided that you have SQL Server there. ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.server)
  • Re: Prepared statement doing table scan
    ... Thanks Erland! ... The idea was to use a plan guide to force use of the index. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.server)
  • Re: Hiding NULL
    ... There are many features in QA that did not make it to Mgmt Studio. ... again, in Mgmt Studio, it's easier to copy and paste from grid, as you ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)