SQL Server Performance

Using Same Query

Discussion in 'SQL Server Reporting Services' started by dmatta59, Feb 9, 2004.

  1. dmatta59 New Member

    Is there a way to write and save a query and then use in various reports.
    The manual method of cut and paste is an option but would think that
    being able to use the same query across several reports would also
    be an option.

    Thanxs,
    dmatta59
  2. jasper_smith New Member

    If you are using SQL then stored procedures or views allow this modularisation/reuse of code (assuming that you are querying the same database). I'm not aware of anything specifically in RS for this however you can create a report template containing in your common query and then copy the resultant RDL file from your project folder to (by default) C:program FilesMicrosoft SQL Server80ToolsReport DesignerProjectItemsReportProject. This means that when you create a new Report Project, the template report will be available when you choose Reports>Add New Item


    HTH

    Jasper Smith
  3. dmatta59 New Member

    Jasper,<br /><br />How could a stored procedure be referenced from the RS interface? <br />As for the template information, it solves another problem for me. <br /><br />Thanxs,<br />dmatta<br />[<img src='/community/emoticons/emotion-2.gif' alt=':D' />]
  4. jasper_smith New Member

    Simply edit the dataset and change the command type to Stored Procedure then type the procedure name into the query string box. It will work out the parameters and if you run the procedure, prompt you for values. Not sure if this is what you were asking ?

    HTH

    Jasper Smith
  5. dmatta59 New Member

    This answers the question for me....

    Thanks!
    dmatta59

    P.S. It just sunk in... duhhhhh!

Share This Page