562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Exporting data from SQL Server Management Studio
Part one of a three-part series of blogs
While SQL Server Management Studio is a powerful tool for writing queries, it has absolutely no concessions towards making the results of those queries remotely presentable! This blog describes several techniques for getting the results of a query into another application so that you can format them to your heart’s content.
SQL Server Management Studio is a great tool for writing queries to return a set of information from a database, but it's absolutely hopeless at formatting the results! If you need to tidy up the results of a query you'll need some way to extract or export them and this blog explains a few of the techniques you can use to do precisely that.
Normally, when you execute a query in Management Studio the results appear in the grid at the bottom of the screen.
The grid is the standard view for displaying query results.
You can change the output of a query using a set of three buttons on the Edit SQL toolbar at the top of the screen.
The first three buttons shown in this screenshot allow you to change the output type of your query.
You can also change the output style of a query by right-clicking anywhere within your query and choosing the option shown in the diagram below:
Right-click within the query and choose Results To, followed by the output type that you want.
Once you've changed the output type you'll need to execute the query again in order to see the changes.
If you choose Results to File from the list of query output types, the next time you run the query you'll be prompted to save a file which will contain the query results.
The default file type is Report files with an .rpt extension.
The files generated by this query output type are designed to be used with Crystal Reports for Microsoft Visual Studio.
This is the message you'll see if you attempt to open the file by double-clicking on its icon.
Of course, this type of output is only useful if you're using Crystal Reports to format your query results! What if you wanted to use a different tool, such as Microsoft Excel, to create reports? Read the next part of this series to find out!
|Parts of this blog|
25 Aytoun Street