Solved

export data from table to flat file

Posted on 2011-03-17
5
516 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
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 500 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Select - Finding chars in a column 2 70
Incremental load example 2 56
Help with SQL joins 9 56
Find data in a column which is not in  a date format 29 36
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

685 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