Oh, there is one issue I wanted to discuss. It's not a problem with your article, but a problem I have struggled with in the past.
I often set the file name like so:
SELECT @File = Substring(Path,1,len(Path)-charindex('\',reverse(path))+1) + @File
WHERE id = 1
Where the value of the @file variable is "Performance", "Duration" or something to that effect. The problem is that if the file already exists the sp_trace_create procedure fails. The two ways I have used to cope with this is check for existence with xp_fileexists and then either bail, or use xp_cmdshell programmatically to remove the file. I have never liked either of my options, and I wish there was a way to automatically overwrite the file if it exists on the sp_trace_create procedure.
I suppose another option would be to check file existence, then append a number in a loop until I get one that doesn't exist.
Do you have any thoughts or suggestions related to this problem?