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

x
?
Solved

export data from table to flat file

Posted on 2011-03-17
5
Medium Priority
?
522 Views
Last Modified: 2012-05-11
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
Comment
Question by:theartha
[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
5 Comments
 
LVL 3

Expert Comment

by:dtrance
ID: 35158476
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
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 35158497
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
 
LVL 4

Expert Comment

by:qasim_md
ID: 35158751
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
 
LVL 4

Accepted Solution

by:
qasim_md earned 2000 total points
ID: 35158786
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
 

Author Closing Comment

by:theartha
ID: 35159098
Thank You. It helped
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
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. …

604 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