Export Data in Text File Using SQLCMD in SQL SERVER 2005

  • Comments posted to this topic are about the item Export Data in Text File Using SQLCMD in SQL SERVER 2005

  • Great script. Keep up the good work.

    My only difficulty is that xpcommandshell is forbidden at some of my production sites.

    ATBCharles Kincaid

  • Okay I seem to be missing something here, the query seems to fail at the SET command. May seem like a silly question but I am failing to also see where the query gets inputted into all this. Can some one please help...the description of the script sounds like a perfect fit for what I am trying to do. I have 3 sql scripts that I have to run in order to get a output which I copy paste into txt file. This script sounds like it would eliminate that problem.

  • What is the max size of the file that can be created using this method? I am trying to write a text file in more or less same manner, but it wont write file above 2 MB 🙁 and the table contents would definitely make the file size go upto or > 10 MB.

    Please suggest.

  • Nice script! As an alternate workaround you could also make use of bcp command.

    Thanks

    Amol Naik

  • This seems to be nice. However, I ahve a question. I am trying to get SQL to create a tab delimited text file but I keep getting a comma delimited text file with the stored procedure I use. Now, I am wondering what kind of text file is created using the code you have given also will it be possible to specify what kind of text file can be output?

    Thank you,

    Asha

  • Thanks for the script.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply