In Sql Server when you select to modify a SP or UDF it loads the objects alter query in a query window. Are these queries accessible in a system table so I can store the alter statements somewhere? It looks like syscomments has some objects but not all of them.
Thanks
Don’t use syscomments, because
syscomments.textisnvarchar(4000)and as a result will truncate anything that is longer.Use
sys.sql_modulesbecausedefinitionisnvarchar(max), it will not truncate long code.use this to view the text of a given procedure, view, or function:
Use this to get the name, type, and text of any procedure, view, or function: