Solved

export data from table to flat file

Posted on 2011-03-17
5
512 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank You. It helped
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now