Link to home
Create AccountLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

SysTable info

Which systable holds information on which fields will be returned by a given stored procedure ?
I can find the parameter fields but have no luck finding the returned fields..

Alex
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Sorry, my cut-and-paste skills are showing...

SELECT OBJECT_NAME(id)
    FROM syscomments
    WHERE [text] LIKE '%column name%'
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1
    GROUP BY OBJECT_NAME(id)
Whta's the benefit of going like that.. You can easily identify ypur return value from the procedure itself ...
Avatar of AlexPonnath

ASKER

Your below query returns the stored procedure name but that still doesnt help me much since i knew the id before

SELECT OBJECT_NAME(id)
    FROM syscomments
    WHERE [text] LIKE '%column name%'
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1
    GROUP BY OBJECT_NAME(id)

so my problem is that there seems to be no easy way to parse out the column names from the stored procedure.
Is there another way to do this ?
No, there is no simple way to do that as far as I know. Your best bet is what aneeshattingal mentioned - open each stored procedures to see what it does.