2
votes

Is there a way to specify the transaction isolation level when Crystal Reports queries a SQL Server 2005 database without resorting to any of the following:

  • Encapsulating the report's query in a stored procedure that executes SET TRANSACTION ISOLATION LEVEL... before the query itself
  • Hand-writing the SQL query in Crystal Reports to execute SET TRANSACTION ISOLATION LEVEL...
1
What are you using to connect to the server? (i.e. ADO.NET via SqlClient, ODBC, OleDb? JDBC? etc.) - boydc7
@chadhoc: I am trying to accomplish this via the Crystal Reports application. I am not writing code to use the database connectivity libraries you mentioned. I want Crystal Reports to automatically configure its database connections when it uses the database connectivity libraries. - Adam Paynter
crap, I was afraid of that - unfortunately, I won't be much help there. I think if you're using ODBC via C.R. that you would have the option of making some registry updates, or creating a DSN on the system that would specify the iso level you want to use, but if you're using anything else (i.e. OleDb, JDBC, etc.) I'm not going to be much help. - boydc7

1 Answers

1
votes

I was able to embed this in a Command object:

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ

--Command objects need to return a value
SELECT GetDate()

This Command object was in addition to the query that I 'wrote' in the Database Expert.

Will you elaborate on the necessity of setting the ISOLATION LEVEL?