Contents 

SQL Data Sets - Online help

Prev Page Next Page

Creating a result set package

In this example, we will create a result set package containing 2 data sets from a Microsoft SQL Server 2005 database.

First, we'll need to connect to the database server. You do this by selecting the Database > New connection menu item,

connect04

or by clicking on the New connection
(connect) toolbar item. The Connect to Database dialog is displayed.

connectadventureworks

Enter the necessary login details to connect to the server, and select the AdventureWorks database. Click OK
to connect to the database.

Enter the following query in the SQL workspace, and run the query by pressing F5
, or clicking on the Run query (runquery) toolbar item.

SELECT c.Name Territory, a.ProductID, SUM(a.OrderQty) OrderQty  
FROM SalesOrderDetail a  
INNER JOIN SalesOrderHeader b ON a.SalesOrderID = b.SalesOrderID  
INNER JOIN SalesTerritory c ON b.TerritoryID = c.TerritoryID  
GROUP BY c.Name, a.ProductID  
ORDER BY c.Name, a.ProductID  
SELECT b.Name Category, a.ProductID, a.Name, a.ProductNumber, a.Color, c.ThumbNailPhoto   
FROM Product a  
INNER JOIN ProductCategory b ON a.ProductSubCategoryID = ProductCategoryID  
LEFT OUTER JOIN ProductPhoto c ON a.ProductPhotoID = c.ProductPhotoID  
ORDER BY b.Name, a.Name 
 

SQL Data Sets returns 2 data sets.

gs02r

Let's enter a note in the second data set, for ProductID 168. You can do this by simply selecting any cell in that row, and typing into the Notes
area. A red triangle is displayed on the upper right corner, to indicate that the cell contains a note.

gs11

Now select the Database > Create SQL Data Sets package
menu item

mainmenu-createpackage

or click on the Create SQL Data Sets
(export_data) toolbar item. This starts the Create Package wizard. Select both data sets. Click Next.

gs03

Enter the file name to save the packaged data sets in. Select the Encrypt file
option and enter a password. Enter some comments. Click Next.

gs12

SQL Data Sets will now create a package using the options you selected.

gs05

Congratulations, you've created your first SQL Data Sets package.