Best way to perform a SELECT statement and insert into the same table?

Posted by RPS on Stack Overflow See other posts from Stack Overflow or by RPS
Published on 2010-06-14T12:30:19Z Indexed on 2010/06/14 12:52 UTC
Read the original article Hit count: 94

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005