Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2006
    Posts
    42

    Unanswered: how to generate txt file

    hi all,

    how to generate txt file from sql table. I want text file with respective columns without any seperator between columns. and if for an example a column of int having 5 digits but i want it in text file with 10 digits with remaining all as blanks. guide me how to do this.
    thnks in adv

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    bcp with a format file

    or create a view in the way you want the data, as 1 column then bcp it out as char
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    ...or use the DTS utility.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Feb 2006
    Posts
    42
    thank you.. sorry to say you could have suggest me earlier. anyway thankyou for your friendly hands.

  5. #5
    Join Date
    Sep 2003
    Location
    New York, NY
    Posts
    136
    Quote Originally Posted by chakri
    example a column of int having 5 digits but i want it in text file with 10 digits with remaining all as blanks
    do you need a fixed length text file? If yes, use DTS with ActiveX transformation

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by chakri
    thank you.. sorry to say you could have suggest me earlier. anyway thankyou for your friendly hands.

    What's wrong with what I suggested?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Books Online is your friend to know more about what Brett referred.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •