Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • Yes this is true, but you will loose all procedural functionality as no procedures, udfs, views and such will be stored to call from within queries. (Sorry, edited it, it did make sense in my head X-)) Commented Jan 15, 2010 at 14:40
  • 1
    Yes, but you can call procedures from within other procedures, or use their return as input to a table. Commented Jan 15, 2010 at 14:47
  • @astander: you can call anonymous code from the stored procedures as well. To use their output in an INSERT, you'll need to use OPENROWSET or OPENQUERY which works with the anonymous code as well. Of course there are drawbacks in the anonymous code: for instance, it only runs under the caller's privileges. My point is that it is possible, not preferred way of doing things :) Commented Jan 15, 2010 at 14:50
  • 2
    A CREATE PROC statement must be the only statement in a batch when not using dynamic SQL so you cannot wrap a transaction around the DROP/CREATE when implemented in this manner. There has to be a GO (batch separator) after the DROP PROC call. Commented Jan 13, 2015 at 1:04
  • 2
    The "CREATE OR ALTER PROCEDURE" made my life so much simpler - thank you!! Commented Jul 13, 2020 at 17:53