Does anybody have any suggestions on how to improve the following statements:
insert into ProductInfo with (rowlock) (orderid, productname)
select 66673, FileInfoId
from ProductInfo with (nolock) where
ProductId = 66671 and
IsEligableForCopy = 1 and
ProductFileInfoId >= 2768395941 and
ProductFileInfoId < 2768405941
It sounds like it is timing out because it fails to obtain a lock. What DBMS are you using? And have you tried it without requesting a lock? The example you present appears to be a one-time insert, but I assume this is just an example, as opposed to something you would run in production.