Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get the SQL statement that CR uses?

Status
Not open for further replies.

TonyScarpelli

Programmer
Jan 23, 2003
361
US
I created a report that used data from two tables in a SQL database. When run the report must be accessing the data through a SQL statement.

Is it possible to see that statement somehow?

Thanks.


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
Version 8 or 9 - on the toolbar, click Database - Show SQL Query
 
Also whatever you've placed in the record selection formula should be represented in the Database->Show SQL Query

If not, you need to redesign the record selection formula.

-k
 
I am using the bundled version of CR for .NET 2002. I have a report that is using three tables from my database, and it runs very slow. I am thinking that the SQL statement for my report is grabbing much more data than it needs to from the database. I am trying to view the SQL query in order to optimize it. My problem is, I can see the view SQL query menu item under database but it is greyed out and unselectable. Can anyone help?

Thanks in advance.
 
Hi,

You can run an ODBC trace to see the SQL statement that is getting passed to your database.

Go to Start > Settings > Control Panel > Administrative Tools > Data Sources ODBC > Tracing Tab
 
Hi,

"Slow" is in the mind of the beholder. A bit more information would be useful.

What database (Oracle, Access, etc.) is being accessed? How many records are in each table?
How many seconds does it take to get results back?
How many records are returned?
Are you selecting records based on keys/indices?

rgds,
mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top