Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:40:50+00:00 2026-05-24T06:40:50+00:00

I have looked at this question which is essentially the same but the OP

  • 0

I have looked at this question which is essentially the same but the OP accepted ‘using other tools’ as an answer. Basically, I am trying to export data from a table to a delimited file but because of the 8192 character limit, the output text is getting truncated. I could not find any good approaches that work (for me at least).

If SSMS and sqlcmd (not sure if the limitation applies to this as well. I am trying at the moment) are my only options, is there a way to workaround this limitation and dump text columns of higher widths?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:40:51+00:00Added an answer on May 24, 2026 at 6:40 am

    Have you considered using a simple PowerShell script or a command-line app using C#? If it can SELECT all of the data then it should certainly be able to write it all to a file.

    EDIT 2011-08-03

    I was unable to get this working with PowerShell or sqlcmd. The former seems to truncate output at 4000 characters and the latter at 256. However my good old friend VBScript once again proved that new and shiny is not always the best… the code is much more tedious to write, but it works. Save as .vbs file, make the appropriate changes to lines 2, 3 and 6 (and 9 if you want more columns, transformation of the data, different delimiters, etc).

    set conn = createobject("ADODB.Connection")
    conn.open "provider=SQLOLEDB.1;data source=.;user id=user;password=pass;"
    set rs = conn.execute("SELECT VarcharMaxCol FROM dbo.TableName")
    
    set fso = createobject("Scripting.FileSystemObject")
    set f = fso.CreateTextFile("c:\path\from_vbs.csv", true)
    
    do while not rs.eof
        f.writeline vbCrLf & rs(0)
        rs.movenext
    loop
    
    rs.close   : set rs   = nothing
    conn.close : set conn = nothing
    f.close    : set f    = nothing
    set fso  = nothing
    

    I will post back here if I get any answers from my PowerShell guru friends about how they deal with > 4K.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked around on the Internet trying to answer this question. It seems
Ok, I ran into this tree question which LOOKED simple, but started driving me
I realise this question has been asked 100 times, but i've looked through the
I have looked all of the place for this and I can't seem to
I've looked at this and it wasn't much help. I have a Ruby program
I have some accesses from 192.168.0.71 on my apache logs. I looked up this
I have looked at the Suggested related questions but none of them are what
Ok this is more of general technology/approach question. We have a very simple web
I have an xml file which describes (among other things) elements with attribute values
i have a input tag which is non editable, but some times i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.