Re: Auditing SP Execute.

From: Jasper Smith (jasper_smith9_at_hotmail.com)
Date: 02/23/05


Date: Wed, 23 Feb 2005 22:06:53 -0000

As long as the users only have execute permissions on the proc i.e. they
can't change it, then just add some code at the start of the proc to log to
a table passing getdate() and suser_sname() to capture the time and user
executing the proc. This assumes that the app doesn't use a single service
account (in which case you won't be able to get the user name without
modifying the app to stuff it into context_info)

-- 
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Pranay Pandya" <ppandya@gmail.com> wrote in message 
news:1109178725.456740.135850@z14g2000cwz.googlegroups.com...
> To meet audit requirements, I have to maintain an audit log of when a
> particular sp was execute and by whom.  I am not willing to use the c2
> option for just one stored procedure.  There are 2 users who can run
> the stored procedure from enterprise manager or query analyser (others
> run it from an app). Any suggetions?
> Thank You,
> -pranay
> 


Relevant Pages

  • Re: Auditing SP Execute.
    ... > As long as the users only have execute permissions on the proc i.e. they ... This assumes that the app doesn't use a single ... > Jasper Smith (SQL Server MVP) ... >> particular sp was execute and by whom. ...
    (microsoft.public.sqlserver.security)
  • Re: nested stored procs
    ... > I was hoping I did not have to trawl through my app to change the parameters ... > passed to stored proc A ... >>> I have a stored procedure B which calls stores procedure A ...
    (microsoft.public.sqlserver.programming)
  • Re: bcp error when queryout is stored procedure
    ... BCP tries to get how the result set will look like in order to generate the file format correctly. ... (proc)" you will execute so that the temp table will actually be created, but be aware that the proc ... > Real stored procedure is very large and it populates temporary table through ...
    (microsoft.public.sqlserver.tools)
  • Re: CURSOR problem
    ... each row in the result set of the proc. ... the proc into a temp table and then run the cursor against it. ... getAccountsData is a stored procedure. ... I cant execute ...
    (microsoft.public.sqlserver.programming)
  • Re: form want close
    ...  Then you execute READ EVENTS, which halts. ... I changed it to modeless and I can close it, but if call the proc from ... within the app, it is never displayed. ...
    (microsoft.public.fox.vfp.forms)