Solved

Simple MS Sql query tool

Posted on 2010-09-24
8
563 Views
Last Modified: 2012-06-21
Can anyone recommend a simple ms sql query tool to export queries into an excel spreadsheet?
0
Comment
Question by:ptmjdlee
[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
8 Comments
 
LVL 16

Assisted Solution

by:carsRST
carsRST earned 500 total points
ID: 33753333
BCP is very easy to use.  You can export to a csv file, which works very nicely in Excel.

It's a free command line tool included with all versions of SQL Server.

http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/

0
 
LVL 16

Expert Comment

by:carsRST
ID: 33753361
Another command line option is SQLCMD.

See below for exporting to CSV.

http://stackoverflow.com/questions/425379/how-to-export-data-as-csv-format-from-sql-server-using-sqlcmd

Note, if you want to export directly to an Excel format, you'll probably need to use SSIS or an openrowset.

0
 
LVL 2

Expert Comment

by:willz123
ID: 33753817
using SQL server management studio you can also export the results to csv, just right click one of the column headers in the output window and click "Save Results As..."
0
Free eBook: Backup on AWS

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

 
LVL 12

Expert Comment

by:Anuradha Goli
ID: 33753854
Exec

sp_configure 'show advanced options', 1
Reconfigure

Exec

sp_configure 'Ad Hoc Distributed Queries',1
Reconfigure

Exec

sp_configure 'OLE Automation Procedures', 1;
Reconfigure

Exec

sp_configure 'Agent XPs', 1;
Reconfigure

Go

Select * From OpenRowSet('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=X\XXX\XXX.xls' , [Sheet1$])
Exec
 
sp_configure 'show advanced options', 1
Reconfigure

Exec

sp_configure 'Ad Hoc Distributed Queries',0
Reconfigure

Exec

sp_configure 'Ole Automation Procedures', 0;
Reconfigure

Go
0
 

Author Comment

by:ptmjdlee
ID: 33755256
What I've used in the past has been Embarcaderro or PL/SQL with Oracle dbs. Is there a simple version of these types of software that I can use to extract some data from my ms sql database?
0
 
LVL 16

Accepted Solution

by:
carsRST earned 500 total points
ID: 33755288
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 34299493
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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…

738 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