My .net code kept complaining about uninitialized counters whenever it tried to access SQL Server, ‘The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly’. I opened Performance Monitor and sure enough the SQL counters had vanished. Now I’m not sure why that is, I did have some trouble with a recent service pack to Analysis Services so I’m guessing that’s what struck. With a bit of fishing around I managed to discover how to recover the counters;
Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>lodctr perf-SQL2005sqlctr.ini