Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to get params and values passed to proc

Author  Topic 

gf
Starting Member

2 Posts

Posted - 2007-05-11 : 12:08:06
Does anyone know if there is an easy way to get the parameter information that was passed to a proc?

I've got some auditing which tracks the proc name, user who ran it, date/time etc, but it would be really helpful to know what values were pass to these procs. I'd have to update a few hunderd procs so I don't want to construct a string for each one if I don't have to.

I guess I'm looking to find out if there's some variable/way to get the string you'd get in profiler ex: "exec proc_name @param1=val1, @param2=val2" from within the stored proc at runtime.

many thanks for all who contribute.

-gf

nr
SQLTeam MVY

12543 Posts

Posted - 2007-05-11 : 12:29:03
You could do it in VB.
Interogate the SP parameters then edit the SP script to add an auditing line at the begining.
I add a write to a table which has <@p1=val><@p2=val>
Doesn't give you anything you can execute but gives all the parameter values.

I have an app which gets the SP parameter info (amongst other things) here
http://www.nigelrivett.net/VB/ADOScema.html

Could probably be done in VBScript too.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

gf
Starting Member

2 Posts

Posted - 2007-05-25 : 17:31:26
Many Thanks. I'll give that a try.
Go to Top of Page
   

- Advertisement -