Jane – I'm guessing you are running this from the Crystal designer instead of Custom Reports menu. The SQL stmt Crystal forms is handled by the SQL Query Optimizer. Sometimes though based on how you joined and grouped the tables it can lock records temporarily. Classically seen with some MS Access queries on large SQL data sets.
If you're able to run from Custom Reports, Sage will populate the report data in TempDB and generally this alleviates the potential locking and contention issue. But if you have to run from Designer
- Verify Use Indexes is checked in File / Report Options
- Run a SQL Maintenance Plan to rebuild indexes or reorganize indexes if it hasn't been done for awhile (start by just doing this only)
- Choose Perform Grouping on Server in File / Report Options
- In Mgmt Studio create a view to join the table you need and add the columns the rpt will need. Now you have a few options:
a. Index the view. Then change your rpt to use the view instead of separate tables
b. Create a stored procedure (proc) who's only purpose is to run the view. Then in Crystal go to File / Options / Database and tick Stored Procedures. Then Verify Database and now the proc will appear along with tables and views.
------------------------------
Alnoor Cassim
------------------------------