Is there a way in SQL 2008+ to request a lock on a SQL object before attempting to modify it? For example if I was writing a piece of code to dynamically update a stored procedure and I want to lock the stored procedure before doing the alter.