Are there ways to only replace SQL Server stored procedures when the definition has changed?
Permissions shouldn't be assigned to the stored procedure

Your stored procedure should sit in a schema, permissions are on the schema (granted to roles). This way, new objects in that schema have permissions automatically. No single object should have permissions

So either way would be OK.

See these other DBA questions:


Set permissions on all objects for SQL users
What standard should I follow when naming tables and views?
Schema design - best practices?


FYI, object_id is signed int so use "does not equal"

if object_id('my_proc') &lt;&gt; 0 drop procedure my_proc


Edit, nvarchar(max) is comparable directly

if object_Id('my_proc') &lt;&gt; 0
    drop proc ThenewProc
GO
CREATE PROC ThenewProc
...
GO

IF object_definition(object_id('my_proc')) &lt;&gt; 
         object_definition(object_id('ThenewProc')) &lt;&gt; 0
BEGIN
    drop procedure my_proc
    drop proc ThenewProc
END
GO
CREATE PROC my_proc
...
GO