Hi,In SQL Server we can ALTER a procedure/view/function, etc... if it already exists, keeping the same object_id and as a consequence the same rights. If the object doesn't exists we CREATE.The result of that is that in installation scripts that should be agnostic to a version of the object already being present we face the choice between dropping the object first if it exists and recreating it and redefining the rights on it, or maintaining the code of the object 2 times in the script (IF OBJECT_ID('something') IS NULL CREATE ... ELSE ALTER ...Why not have a CREATE OR ALTER PROCEDURE statement that alters if it exist and creates if it doesn't exist?
Category
Proposed Solution
Benefits
Other Benefits
Please wait...