Crystalkeen logo
Crystalkeen header image 3
Crystalkeen header image 5

Crystal Reports Tools: Improve Performance While Saving Time and Money




CR Schedulers
CR Viewers
DataBase Tools
Mail UFLs


About us

Contact Us

on Steroids

Crystal Reports: SQL Commands to Create Audit Records

Use SQL commands to create audit records of your reports.

SQL commands are a powerful feature, introduced in Crystal Reports 9. In other articles, we mentioned that you can use them with UNION joins, Sub-SELECT clauses, and Parameters. 

But, there is more power there than first appears. You can also use SQL commands to perform DELETEs and UPDATEs in your database. 

To create an audit record every time the report is processed, use an SQL command of:

INSERT INTO Audit (User, RunDate) VALUES (‘{?UserID}’, GETDATE())
SELECT * FROM Customers

If this raises any security concerns, use the Database security to restrict your Crystal reports designers to “read only” access and these SQL commands will not process.

Who should view these audit records? That's a good question, and the answer is you need to determine who has a need to know. If the reports are used for financial purposes, then whoever audits your company's finances has a need to know.

Another issue arises, and that is the existence of the audit records makes the subject to subpoena, rights of discovery, and warrantless search by govt agents. No matter what security protocols you have, a surprise visit by armed govt agents means your records will be at their disposal. So consider carefully if you want those records to exist. They may protect your company, or they may do the opposite.


This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects.


  • Questions? Please write to We do want your business.
  • Do you have your own tips for Crystal Reports administrators and designers? Write to and we'll post your tips with a link to your Website (or with some other attribution if you choose).
  • Crystal Reports is a subsidiary of Business Objects, which is owned by SAP.