Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-03-30
5
Medium Priority
?
562 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
0
Comment
Question by:StanleyLMW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 2000 total points
ID: 24017145
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
 

Author Comment

by:StanleyLMW
ID: 24017602
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
 
LVL 22

Expert Comment

by:pivar
ID: 24017966
I wasn't aware that bcp is going to be replaced. Where have you seen that?
0
 
LVL 22

Expert Comment

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

Author Comment

by:StanleyLMW
ID: 24019033
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question