Hi all,
I've got a .net 3.5 website that calls thousands of different stored procs using Microsoft.Practices.EnterpriseLibrary.
We have been getting alot of timeouts and after some playing and testing the use of (nolock) on the end of the table join in stored procs works real well and reduces the timeouts.
I want to now do this to all sps. I could add (nolock) to all table names, however a better idea is to set the isolation level using in SQL "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"
I dont want to add this to the start of all sp's (as there are so many) so was looking for a way to add it to the connection.
An example of the code to call a sp is as follows
public static int ExecuteNonQuery(string sStoredProcedureName, params object[] parameterValues)
{
Data.Database db = Data.DatabaseFactory.CreateDatabase();
using (DbCommand command = db.GetStoredProcCommand(sStoredProcedureName, parameterValues))
{
return db.ExecuteNonQuery(command);
}
}
I'm thinking this setting is a config setting in the web.config but cant figure out what it is, or if I'm on the right track.
Any help is really appreciated.
Cheers Amjid