SQL Profiler irritating "feature" - "You don't have permission to open this file" Trace
Hi all,
Ok, this is a very irritating feature that took a bit of searching before I figured out what was going on. I have a Windows 7 machine with SQL Server 2008 Dev installed. I set up a trace via the SQL Profiler so that I could detect Blocking transactions. I started the trace (not in the gui but as a script within the query analyzer) and did a repro. Once I caught my data I saved it and stopped the trace. I was able to import into a temp table via
SELECT * INTO dbo .MyTraceTable
FROM fn_trace_gettable( 'c:\temp\MyTrace.trc' , default );
GO
There after I tried to load the trace into the profiler (I had taken the Deadlock Graph) and wanted to see the image that was created. Instead of loading I received a rather annoying error message: "you don't have permission to open this file"! WTH! I am an administrator on my laptop and that account is a sysadmin in SQL and yet I am not allowed to open my own file that I created! This was a bit of a headscratcher.
To make a long story short the simple solution is to run the SQL Profiler "as administrator".
One of these days I really need to sit down and try to figure out how the UAC works otherwise there will never be a truce in my on-going war with it.
regards, Norman