One of My Favorite Undocumented T-SQL Snippets

While there are tons of undocumented T-SQL commands out there, one of my all-time favorites is this little gem:

SELECT SERVERPROPERTY('ErrorLogFileName');

It’s not much, but it will show you default details on:

ErrorLogFileName

 Arguably, there are better ways to retrieve some of this information (like SELECT * FROM sys.dm_server_registry;).

But SERVERPROPERTY(‘ErrorLogFileName’) works just fine when looking for low-level details.

The only real problem I have with this particular snippet of T-SQL is that I can never remember EXACTLY what the property is to ‘search’ for (i.e., ‘ErrorLogFileName’) – which is part of why I’ve blogged about it (so that I’ll be able to more easily find this snippet in the future).


No responses yet

Leave a Reply