While it is true that you can do this, it is not recommended. In order to minimize the affects on concurrency, locks should be held for the least amount of time possible.
In all of my years of developing applications against SQL Server, I have only used locking hints to hold locks once and, as it turns out, there was a better way to achieve the results that I needed.
-Mike
>I can use transaction with holdlock rowlock, ex:
>
>sqlexec(mycon,"BEGIN TRANSACTION")
>sqlexec(mycon,"SELECT field1 FROM mytable WITH (HOLDLOCK ROWLOCK) WHERE field2 = ?field2value")
>..
>...
>...
>
>...
>sqlexec(mycon,"COMMIT TRANSACTION")