I tried Profiler but it froze and crashed when I ran it. I think I need a complete reinstall.
That aside, it would be nice if I could place something in my SPs which would send details of a rogue parameter. At the moment I have this:
declare @success bit
declare @spname as nvarchar(50)
set @success = 0
set @spname = object_name(@@procid)
-- Update code would be here
if (@@error <> 0)
begin
raiserror ('Error %i has occurred in the stored procedure %s while updating records.', 16, 1, @@error, @spname)
goto ErrorHandler
end
set @success = 1
ErrorHandler:
return @success
I'd love to be able to modify this so that it gives me the name of the parameter.