I know that to use timeout is not the very best thing to do,but sometimes depending upon the critical circumstances we need to do that. And yes you can not calculate the exact time of execution for the update query as it depends on various factors, but to
find the approx time you can directly run your update query in query analyzer and see the execution time. Also for better user friendly performance you can add the updateprogress control of ajax in your webform so that user can get idea about the progress
going on at backend.
I put an index on the field cv_id, however, the System.Data.SqlClient.SqlException: Timeout expired error still occurred. I then decided to change my update statement so instead of this:
update tbl_covernote
set covernote_text=@covernote_text
where cv_id=@cv_id
I changed it to:
update tbl_covernote
set covernote_text=@covernote_text
where covernote_id=@covernote_id
I decided to do this because the second update statement is updating using the covernote_id field, which is the primary key field within the table. I thought by using this it would increase the speed/ performance of the udpate query, however, still the System.Data.SqlClient.SqlException:
Timeout expired error is occurring!
Please, does anyone else have any other solutions I could try to fix this problem? This error is causing a real problem on my site now because when it happens, alot of other sql queries carried out on the database do not work.
NiravVyas
Participant
1202 Points
268 Posts
Re: SQL Statement Timeout
Jan 20, 2010 02:48 PM|LINK
I know that to use timeout is not the very best thing to do,but sometimes depending upon the critical circumstances we need to do that. And yes you can not calculate the exact time of execution for the update query as it depends on various factors, but to find the approx time you can directly run your update query in query analyzer and see the execution time. Also for better user friendly performance you can add the updateprogress control of ajax in your webform so that user can get idea about the progress going on at backend.
Thanks
Thanks
Nirav
katie_27
0 Points
6 Posts
Re: SQL Statement Timeout
Feb 18, 2010 08:09 AM|LINK
Hi Folks
I put an index on the field cv_id, however, the System.Data.SqlClient.SqlException: Timeout expired error still occurred. I then decided to change my update statement so instead of this:
update tbl_covernote
set covernote_text=@covernote_text
where cv_id=@cv_id
I changed it to:
update tbl_covernote
set covernote_text=@covernote_text
where covernote_id=@covernote_id
I decided to do this because the second update statement is updating using the covernote_id field, which is the primary key field within the table. I thought by using this it would increase the speed/ performance of the udpate query, however, still the System.Data.SqlClient.SqlException: Timeout expired error is occurring!
Please, does anyone else have any other solutions I could try to fix this problem? This error is causing a real problem on my site now because when it happens, alot of other sql queries carried out on the database do not work.
Please help.
Kate.