I was looking for a way to generate object definition (in my case stored procedure defintion) in SQL 2000 like I can get in SQL 2005 : select definition from sys.all_sql_modules.
I was looking for a way to generate object definition (in my case stored procedure defintion) in SQL 2000 like I can get in SQL 2005 : select definition from sys.all_sql_modules.
One place the text is available in SQL2000 is
syscomments
.The text in each row is limited to 4000 characters, so there will be more than one row for larger objects. In this case the
colid
column identifies the order of the rows (1 being the first chunk, 2 the second, and so on). For instancesp_WhoIsActive
in themaster
database is long enough to have many rows insyscomments
.