There are a lot of samples out there. Here are a few:
http://www.wwwcoder.com/tabid/68/type/art/parentid/191/site/6508/default.aspx
http://www.sqlteam.com/article/introduction-to-locking-in-sql-server
Another point here. Depending on what you are trying to do, concurrency may be an option as well as record locking can very easily tie into concurrency. For example, if you are using row versioning, it would be very easy to determine if someone else has touched that record when you save. If so, then you can take it into account.
Another option would be transactions. Going through transactions can also play into the process here as when you start a transaction you can prevent anyone else from touching the records until the transaction is complete. This is actually the approach that we take in our medical software when this could be a potential issue.