Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

RE: Expand / Collapse
Posted Wednesday, October 26, 2005 4:13 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Saturday, October 8, 2016 1:48 PM
Points: 351, Visits: 2,139
Not exactly Query Analysers best kept secret - more Excels super ability to absorb data in an expected manner from numerous sources including the clipboard.

As someone who has spent 5 years having to produce bespoke Excel reports from both Oracle and SQL Server databases, heres my advanced tips:

Excel can have the microsoft query engine installed with it, go to:
Data -> Get external data -> New database query

You may be prompted to click OK to install the correct components. Now you will need to set up the database connection but this will be saved for future queries.

If you save the spreadsheet the query is also saved so the data can be refreshed at the click of a button.

If your database is web enabled then with some practice you can dump the output into a HTML table and use excel to pick it up - I personally use XML and the IIS XML support (watch out for security issues here!!).
Data -> Get external data -> New web query

If your system produces ASP then then you *should* be able to generate an Excel spreadsheet on the fly... The user may just have to click a link and the browser will open Excel for them.

I've NOT done this with SQL Server myself, however I did get it working with the web services on Oracle 8i.

Super advanced method, using VBA you can write your own query editor with excel which will then nicely format the result. The data can be collected using either the web query or a database connection, which ever method you choose it can be scripted with VBA.

Post #232332
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse