• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 568
  • Last Modified:

MS SQL server 2005 : How to use SQLCMD to export data into fixed column format?

Hi,

I'm now using MS SQL 2005 and we would like to use the SQLCMD to export data from SQL server into a fixed column format text file.  Since our programs are programed in a way that accept fixed column data and re-program them to use other format seems not a feasible solution.

Kindly please help
0
StanleyLMW
Asked:
StanleyLMW
  • 3
  • 2
1 Solution
 
pivarCommented:
Hi,

It sounds like you should use BCP instead.

http://msdn.microsoft.com/en-us/library/ms162802.aspx

You can describe the format in the bcp format file.

/peter

0
 
StanleyLMWAuthor Commented:
Hi Peter,
Thx for your reply ... but, as mentioned by Microsoft, the BCP command is going to be replaced by SQLCMD.  Since this program will be used for long, so we would like to use SQLCMD instead rather than changing the program say after 1 or 2 years.
Any idea on how to do it using SQLCMD?
Stanley
0
 
pivarCommented:
I wasn't aware that bcp is going to be replaced. Where have you seen that?
0
 
pivarCommented:
osql is going to be replaced by sqlcmd. Perhaps that's what you're thinking of?
0
 
StanleyLMWAuthor Commented:
Hi Peter,
Maybe I got the wrong information from my friend.  You are right.  Only OSQL will be replaced.  Then I try bcp first.  Thanks a lot.
Cheers
Stanley
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now