Read the properties of a Stored Proc from CF?

I am looking to access the properties of a stored proc, specifically so I can filter out SPs that do inserts, updates and deletes and list only SPs that execute SELECTS. Anyone have ideas how to do this?
LVL 2
KoldFuzunAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tacobell777Commented:
I would have to say thats almost impossible, unless you save the SPs as text file and run a regex over it.
Tacobell777Commented:
you could probably interogate the system tables for the sql in the SPs as well, but you would still have to write regular expressions to find what you are looking for.
Tacobell777Commented:
what is the reason for wanting to do this?
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

KoldFuzunAuthor Commented:
I want to allow SPs to be run in an app, but I do not want to execute any SPs (accidentally or maliciously) that do anything but selects. I have been looking through the system tables but cant seem to find anything which indicates the function of a SP

danrosenthalCommented:
<CFSET sp_name = "mystoredprocname">

<CFQUERY datasource="#DSN#" name="get_sp_detail">
      SP_HELPTEXT #sp_name#
</CFQUERY>

<CFSET sp_text = "">
<CFOUTPUT query="get_sp_detail">
      <CFSET sp_text = sp_text & text>
</CFOUTPUT>

<TEXTAREA cols="90" rows="20">
<CFOUTPUT>#sp_text#</CFOUTPUT>
</TEXTAREA>

<CFIF FINDNOCASE("insert",sp_text)>
      Insert not allowed<CFABORT>
</CFIF>
<CFIF FINDNOCASE("delete",sp_text)>
      Delete not allowed<CFABORT>
</CFIF>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KoldFuzunAuthor Commented:
This seems to be a solution I can use, thanks! However, the wierd thing is I get an error with one proc.... if I skip that proc it works fine. I dont want to run into this with future issues, so maybe you can help me figure out why it is erroring? The SP name has no special characters or spaces in it
danrosenthalCommented:
What is the error?
KoldFuzunAuthor Commented:
ahhh nevermind. it had a - in the name. When I removed it, it worked fine
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.