Larry Brister
asked on
Capture executed SQL
Is there a way to capture what was last executed on a stored procedure?
Other that this... I have a table I just insert what was passed in
But I don't want to do this on every proc
Other that this... I have a table I just insert what was passed in
But I don't want to do this on every proc
SET @CaptureExecSQL = 'EXEC [dbo].[ewUpdatePaymentsbyPartialRefund_Capture] @InvoiceID = ''' + @InvoiceID + ''' , @AmountRefunded = ''' + CAST(@AmountRefunded AS NVARCHAR(300)) + ''' , @AmountRefundedActual = ''' + CAST(@AmountRefundedActual AS NVARCHAR(300)) + ''' , @UserID = ''' + CAST(@UserID AS VARCHAR(50)) + ''''
INSERT INTO dbo.ewSQLSearch
(
SQLProcedure,
SQLCode,
DateAdded
)
VALUES
( 'RefundCapture', -- SQLProcedure - varchar(max)
@CaptureExecSQL, -- SQLCode - varchar(max)
GETDATE() -- DateAdded - datetime
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window