Did you know... you can change the sql of a query in report studio?

In report studio, you typically create queries by dragging the metadata into a query.  However, in some cases you're just not satisfied with the SQL that query generates, and you want to go and fiddle with it.

There's an easy way to do so, just click the query you want to edit, and click the "Generated SQL" property.  A window pops up that shows you the SQL, and click the "Convert" button at the bottom of the dialog.


In the dialog that follows, just change the query.


Click OK, and you will see that Report Studio changed the query in to a SQL query object.


Please note that running SQL directly in your report is a separate capability that can be activated or deactivated in the security settings in Cognos Administration.  The same thing can be done with MDX when creating a report on multidimensional data.

The message is : use caution when editing your own query.