This was written as a quick versioning control for stored procedures that I was working on.
Usage:
<stored proc code>
IF @@ERROR = 0
BEGIN
EXEC AX_BackupRoutines <proc name>
END
To retieve data
SELECT ObjectText
FROM ObjectHistory
WHERE ObjectName = <proc name>
AND Version = n
where n is a number