We help IT Professionals succeed at work.

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

Stanley Lai
Stanley Lai asked
on
583 Views
Last Modified: 2012-05-06
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
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

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

Commented:
I wasn't aware that bcp is going to be replaced. Where have you seen that?

Commented:
osql is going to be replaced by sqlcmd. Perhaps that's what you're thinking of?

Author

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
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.