I need help creating a trigger that grabs update/insert/delete queries and inserts the entire query into a log database.i have this and if my query uses text it works great.. but if I use parameters it shows the parameters and not the values.I need to capture the tsql with the values(not so much the parameters)CREATE TRIGGER LogSQLON dbo.M8_CustomersAFTER INSERT, UPDATE, DELETEASINSERT INTO dbo.PB_Logs (language_event, parameters, event_info)EXEC('DBCC INPUTBUFFER(@@SPID);');sql query executed in vb.net applicationUPDATE M8_Customers SET CustomerNumber = '" & Dispatch.txt_CustName_Customers.Text & "',CustomerName = @CustomerName,AllowDefault = @AllowDefault,Active = @Active WHERE custID = @custID
trigger inserts to PB_Logs this//UPDATE M8_Customers SET CustomerNumber = '3 V Inc.g',CustomerName = @CustomerName,AllowDefault = @AllowDefault,Active = @Active WHERE custID = @custID