April 24, 2008 at 2:12 pm
I am trying to programatically pull information about the stored procedures of a database to parse out. Which system table stores the text that makes up a stored procedure? I know it is in there, I just can't remember where...
Also, would it be in the same place for sql server 2000 or a different location?
Thank you.
April 24, 2008 at 2:15 pm
SQL 2000 has it in syscomments, 2005 has it in sys.sql_modules.
Syscomments breaks it up into 4000 character chunks (if I remember correctly), so it can take more than 1 row.
Sys.sql_modules keeps it all in one place, using varchar(max).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 24, 2008 at 2:39 pm
Thank you for the help.
Cheers
April 24, 2008 at 2:45 pm
I'm look through the dbs, and don't see sys.sql_modules. Where should I be looking?
Thanks.
April 24, 2008 at 3:08 pm
It's listed under system views in each database.
Greg
April 24, 2008 at 3:14 pm
got it, thank you.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply