Solved

Simple MS Sql query tool

Posted on 2010-09-24
8
559 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
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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