Link to home
Start Free TrialLog in
Avatar of Lexie
LexieFlag for Zambia

asked on

Stored procedure in the system table

Well,

I am just wondering how I can get the stored procedure out of the system tables. The reason for that is that every stored procedure starts with a heading with the purpose and author of it. So I would just like to filter this out of the stored procedure and create a document of it.

Lex van de Pol
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

i'm not sure if i understood correctly, but it might be this:

SELECT ProcName = o.Name, OwnerName = u.Name
FROM sysobjects o JOIN sysusers u ON u.uid = o.uid
WHERE type = 'P'

Cheers
Avatar of Lexie

ASKER

No, I'm not looking for the names but the content. For example, I have the following stored procedure:

-- Purpose: this is just a test
-- Author : just me
CREATE PROCEDURE proc_test AS
BEGIN

blabla

END

I would like to run a query to get the header out of this stored procedure.
ASKER CERTIFIED SOLUTION
Avatar of nigelrivett
nigelrivett

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lexie

ASKER

Thanks, that was what I was looking for!