Design the Query (Report Wizard)

Use this page of the Report Wizard to create a query by either typing the query manually or by using Query Builder to interactively build a query.

The data source type you chose on the Select the Data Source page, a previous page in the Report Wizard, determines the query you can enter on this page. For example, if the data source type is Microsoft SQL Server, then you can enter Transact-SQL statements or stored procedure names. If the data source type is Microsoft SQL Server Analysis Services, the Query pane is disabled and you cannot enter a query directly. You can specify the query by using Query Builder.

Options

  • Query string
    Type a query that retrieves the data you want to use in your report.
  • Query Builder
    Click Query Builder to open a query designer for the data source.

For more information about query designers, see Defining and Managing Report Data.

Example

For the data source type Microsoft SQL Server, the following query retrieves a list of last names from the AdventureWorks database Contact table.

SELECT LastName FROM Person.Contact

For the data source type Microsoft SQL Server, the following query runs the AdventureWorks stored procedure uspgetEmployeeManagers for the employee with identification number 1.

EXEC uspgetEmployeeManagers '1'

See Also

Reference

Report Wizard Help (Report Designer)

Other Resources

Creating a Report Using Report Wizard
Defining Report Datasets
Defining Report Datasets

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

14 April 2006

New content:
  • Added example section.