Hi All, I have one simple query to update old code with new code, but there are estimated 3 million records inside the table and need to update more than 10 to 20 tables. I create index key but at the fist time always face time out problem. do you have any idea how to avoid time out connection. Query as : UPDATE Table1 SET Ccode = @newCode WHERE Ccode = @oldCode UPDATE Table2, 3, 4, .... Appreciate your kindly suggest !
Welcome to the forum... First make sure the query is using the right indexes and run in QA and see how much time it takes... then depends on the update query time you need to adjust application time or you have to write the update code in such a way application should get some response back from SQL server to wait...otherwise you will get the timeout...
Hi, Thanks ur reply. Actually i don't get time out in QA, it takes about 1 min or sometimes more than that. but when calling from the application, every fist time facing the time out connection. do you have any sample how to capture the response back from sql server in the application? Regards.
Check the timeout parameter in Connection string. Increase it if possible. You may also try the update in batches. When you update it may be locking the whole table. So do the update in batches. ALso check the indexes being used. I f you do not have index that may also cause the blocking Madhu