Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

export data from table to flat file

Hello There,

How can I export the data from a table to a flat file. I am using SQL Server 2005.

Any ideas.

Thanks.
0
theartha
Asked:
theartha
1 Solution
 
dtranceCommented:
There are a few ways to do this.  Either by using the import/export option or simply right clicking on the results table after running your query, and "save results as.."
0
 
EvilPostItCommented:
You could use bcp.

For example

BCP "select * from table" queryout "C:\flatfile.csv" -T -S SERVERNAME -c -t,

Open in new window


You would run this from the command line.
0
 
qasim_mdCommented:
Try BCP Statements with QUERYOUT.

Check this link for detailed solutions for your requirement and needs.

http://msdn.microsoft.com/en-us/library/ms162802.aspx
0
 
qasim_mdCommented:
OR another quick option from the SQL server Management Studio > right click on the Database the table exists> Click on Tasks > Click the Export Data and you will find the options in the NEXT > NEXT options...

did that help ?
0
 
thearthaAuthor Commented:
Thank You. It helped
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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