I have a SQL tag that updates every 5 minutes. It takes about 5 seconds to run. Every 2 or 3 days we will get a deadlock error and lose the tag value until I manually intervene to cause it to execute the query again (usually by opening the tag in the browser and saving it again, or disabling it/reenabling it.)
Is there a way to put something along the lines of a try/except in the SQL driving the tag? I would like it to retain the previous value until the query runs successfully again. Not a big deal if we miss an update every couple of days.
=> Peter: I spent a good part of an hour trying to figure out why I was getting syntax errors on the Try/Catch before figuring out SQL 2000 didn’t support it. Fortunately the DB is scheduled to be updated in the coming months.
=> Phil: I think I may implement your suggestion even if I can resolve the deadlocks, just as a safety measure.
=> Adnaram: I have been trying to educate myself on the pros and cons of NOLOCK. I don’t think dirty data would be much of an issue with my application. I think I am going to try to modify the query to incorporate temp tables instead of all of the nested querying to reduce the chances of a deadlock condition.
Pretty sure I will solve this one way or another, thanks again for the suggestions!