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 2008 Forums
 Transact-SQL (2008)
 Stored Procedure Exec LOG

Author  Topic 

Kalaiselvan
Posting Yak Master

112 Posts

Posted - 2012-09-18 : 08:07:11
Hi,
Its just a general question. Is there any log maintained for Stored Procedure execution in SQL server.

Ex: my Stored Procedure: SP_GetTable
Input Param: @ID INT

On Each execution of this SP a log need to maintained in SQL Server, but Query should not be inside the SP, It must be anywhere outside the SP.

If The SP executes with ID's 1,2,3.
Then the LOG should be as
[PROC NAME] [PARAM] [INPUTPARAM] [OUTPUTTYPE] [OUTPUT]
SP_GetTable @ID 1 Table 3 ROWS
SP_GetTable @ID 2 Table 2 Rows
SP_GetTable @ID 3 Table 5 Rows

Please help me to figure this.



Regards,
Kalai

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-18 : 11:16:40
you can set up custom logging for this for capturing the reauired information.
Are you planning to get this onto audit table?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -