I am basically LAMP developer got some assignment where SQL Server is required. I have installed SQL Server 2008 R2 Express and imported backup file in it.

Now, I want to export user table in excel or csv but not able to do that.

Can anyone tell me how can I export table?


You'll want to look at using SQL Server Integration Services.

If you want to export a small amount of data, you can also SELECT the data in SQL Server Management Studio, and highlight / copy / paste it into Excel, or rt click save as.

  • Ah, I see. So there is no tool here that can export data into readable formate like excel or csv?
    – Shashi
    Jul 13 '12 at 17:42
  • You can do results to file which creates an .rpt file. Seems like I've seen add-ons to spit it out as Excel in the past. You can check this also: simple-talk.com/sql/database-administration/… Or try the wizard: msdn.microsoft.com/en-us/library/ms140052.aspx Also can rt click on your SSMS results and do save to file. That might be easiest if it's a one time export Jul 13 '12 at 18:28
  • Cool, I was able to query and than save as csv. Thx friends.
    – Shashi
    Jul 13 '12 at 18:46

If you are looking for a command-line tool to do something like this, then try BCP. It's a bulk Import/Export command-line utility that comes with SQL Server. It is somewhat limited in it's formatting options, but it can usually do the simpler forms of CSV, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.