Similar to Ron's Logging we call a logging proc through all other stored procedures to assist in getting tracing on all calls.
A common BatchId is used throughout to allow tracing for a certain batch run.
Its possibly not the most performant process but it does help grately in tracking down faults.
Its also pretty simple to compile summary reports to email admins.
ie.
Select * from LogEvent where BatchId = 'blah'
Sample Call
EXEC LogEvent @Source='MyProc', @Type='Start'
, @Comment='Processed rows',@Value=50, @BatchId = @batchNum
Main Proc
CREATE PROCEDURE [dbo].[LogEvent]
@Source varchar(50),
@Type varchar(50),
@Comment varchar(400),
@Value decimal = null,
@BatchId varchar(255) = 'BLANK'
AS
IF @BatchId = 'BLANK'
SET @BatchId = NEWID()
INSERT INTO dbo.Log
(Source, EventTime, [Type], Comment, [Value],BatchId)
VALUES
(@Source, GETDATE(), @Type, @Comment, @Value,@BatchId)
Moving forward it would be nice to leverage the CLR and look at calling something like Log4Net via SQL. As our application code uses Log4Net it would be advantageous to intergrate the SQL side of processes into the same infrastructure.