How do I export a sql server database into a csv file

Posted on 2013-10-02
Medium Priority
Last Modified: 2013-10-22
I need to get a database with at least 10 tables exported into a flat file from Sql Server 2005 how would I do this?
Question by:sikyala
  • 3
  • 3
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39539598
into 1 single file? or 1 file per table?

you can use sqlcmd command line tool coming with sql server to export, see this article:

in short:
SQLCMD -S YourSQLServer -d YourDatabase -U YourUserName -P YourPassword -Q “Your Query” -s “,” -o “C:\Yourfilename.csv”

Open in new window

all the options of sqlcmd tool:

Author Comment

ID: 39540336
I want to export all the tables and any other objects into a single file

Thanks I will look at the link
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39540851
what "export" ... maybe you want to backup the full database, actually?
what do you want to achieve with that "export"?
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.


Author Comment

ID: 39543495
I need to load the database into an oracle database
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 2000 total points
ID: 39544123
then you cannot just export to 1 single file.
it needs to be 1 file per table.

anyhow, I would suggest you check this official Oracle Tool step-by-step guide:

Author Closing Comment

ID: 39591733

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Learn about cloud computing and its benefits for small business owners.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

624 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