SQL Server Developer >> SQLServer2000 Tracing Problems (fn_trace_gettable)
Hello,
My problem is that I want to execute a loop with the fn_trace_gettable
function nested on it. Some files can't be opened correctly, so the
whole batch crashes.
The file exists and I can see its content with SQL Profiler.
I use one script to create trace files and another to see them when
they are closed.
The code I use is:
open Cursor_leer_trazas
begin
'
INSERT INTO SerAud.dbo.tabla_nueva
select *
where TextData is not null
'
end
deallocate Cursor_leer_trazas
I want to continue inserting into SerAud.dbo.tabla_nueva when the
fn_trace_gettable crashes opening one file with the next one. But when
a file cannot be opened the whole batch aborts. So if the first loop
fails, the table SerAud.dbo.tabla_nueva remains empty.