Do we have a sys table which holds the copy of entire stored procedure?
Something similar to syscomments which holds the entire sp in a column? If not available, how to save the entire sp in a column?
Do we have a sys table which holds the copy of entire stored procedure?
Something similar to syscomments which holds the entire sp in a column? If not available, how to save the entire sp in a column?
Yes, the metadata table is called sys.sql_modules:
Returns a row for each object that is an SQL language-defined module in SQL Server, including natively compiled scalar user-defined function. Objects of type P, RF, V, TR, FN, IF, TF, and R have an associated SQL module.
Column definition
SQL text that defines this module. This value can also be obtained using the OBJECT_DEFINITION built-in function.
Another table is INFORMATION_SCHEMA.ROUTINES
SELECT ROUTINE_DEFINITION, *
FROM INFORMATION_SCHEMA.ROUTINES;