title: Altering Stored Procedures in ASE Sybase 15.7
body: <p>I am new to ASE Sybase 15.7 but do have some background in other RDBMS systems. So i assumed there would be an equivalent of CREATE OR REPLACE for Stored procedures in ASE Sybase 15.7.</p>
  <p>But I dont seem to see any way to do this. Most people i have asked suggest dropping and creating with the newer version of the stored procedure but that gives me a challenge of managing the permissions on the stored procedure which are different across environments depending on the users in each.</p>
  <p>So My ask is below:</p>
  <p>Suppose I have a stored procedure as so:</p>
  <p>ENV1</p>
  <pre><code>CREATE Procedure test (
  as
  begin
  SELECT getdate()
  end
  grant execute on test to group1
  go
  grant execute on test to group2
  go
  </code></pre>
  <p>ENV2 has :</p>
  <pre><code>CREATE Procedure test (
  as
  begin
  SELECT getdate()
  end
  grant execute on test to group1
  go
  grant execute on test to group2
  go
  grant execute on test to group3
  go
  </code></pre>
  <p>I want to update this stored proc to give me 2 dates instead of 1 so new proc should be</p>
  <p>ENV1:</p>
  <pre><code>CREATE Procedure test (
  as
  begin
  SELECT getdate(), getdate()
  end
  grant execute on test to group1
  go
  grant execute on test to group2
  go
  </code></pre>
  <p>ENV2:</p>
  <pre><code>CREATE Procedure test (
  as
  begin
  SELECT getdate(), getdate()
  end
  grant execute on test to group1
  go
  grant execute on test to group2
  go
  grant execute on test to group3
  go
  </code></pre>
  <p>Above is a very simplistic example ofcourse. Is there a way to deploy the changes to just modify the stored procedure body preserving the permissions?</p>
  <p>CREATE or REPLACE and ALTER PROCEDURE dont seem to work and dropping and creating the stored procedure would mean additional logic for each environment to figure out the permissions to be granted.</p>
  <p>Is there a way to do this kind of deployment in an optimum way considering we have 20 plus different user environments?</p>
  <p>Thanks!</p>