Monday, February 20, 2012

Problem with Update command

I use a simple update statement to update 1 smalldatetime format field, but I always get a Timeout error.

UPDATE TableName SET Field1 = '8/2/2007' WHERE (Field2 = 'SomeCondition')

Why do I always get this timeout error?

What client are you using to invoke the update statement?

How many rows are in the table?

How many rows will it affect?

Do you have an index on Field2?

|||Through a connection in Visual Basic 2005, I passing the update statement to a SQL server 2000.

The table has barely 10,000 records, and it would affect approx. 30 lines per day.

|||

Here are the key items that you need to watch out for

Try comparing the execution time when running thru Query Analyzer and from your application. If the application and the database resides on different server then how good is your network? See if you have any triggers associated with this table when updating the information. Do you have indexes created for the column your referring to.|||Ok, thank you guys for the prompt replies!

I think the issue is in the code in VB, because with Query Analyzer there's no issue.

No comments:

Post a Comment