Monday, March 12, 2012

Permissions

Does anyone know where the actual code for a stored procedure is stored at? Is it in a system table?your_database.syscomments - ctext field

Originally posted by justastef
Does anyone know where the actual code for a stored procedure is stored at? Is it in a system table?|||Looking in the syscolumns table, I noticed that all of my procedures only have the first part and the last part located in it if they are long. The middle is missing... is this due to the column being only 8000 characters long at a time so its missing a chunk... If this is the case, how can I extract the entire contents of the code of a stored procedure (not through a tool just through t-sql)... is there a command to extract this information?

I also noticed that I named the subject Permissions when I should have typed procedures... lol where is my head today.|||You're right. For each 8000 characters SQL inserts one row in syscomments table, so if you want to extract the text, you'll need to use a cursor and put the text somewhere in a flat file for instance.
I'm not aware of any T-SQL command to extract that info automatically.

Originally posted by justastef
Looking in the syscolumns table, I noticed that all of my procedures only have the first part and the last part located in it if they are long. The middle is missing... is this due to the column being only 8000 characters long at a time so its missing a chunk... If this is the case, how can I extract the entire contents of the code of a stored procedure (not through a tool just through t-sql)... is there a command to extract this information?

I also noticed that I named the subject Permissions when I should have typed procedures... lol where is my head today.

No comments:

Post a Comment