{"id":15,"date":"2016-09-07T16:12:00","date_gmt":"2016-09-07T16:12:00","guid":{"rendered":"https:\/\/overachiever.blog\/?p=15"},"modified":"2026-09-05T16:14:34","modified_gmt":"2026-09-05T16:14:34","slug":"a-favorite-undocumented-t-sql-snippet","status":"publish","type":"post","link":"https:\/\/overachiever.blog\/?p=15","title":{"rendered":"A Favorite Undocumented T-SQL Snippet"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">While there are tons of undocumented T-SQL commands out there, one of my all-time favorites is this little gem:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT SERVERPROPERTY('ErrorLogFileName');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s not much, but it will show you default details on:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Where the SQL Server Binaries have been installed<\/li>\n\n\n\n<li>Where you can find SQL Server\u2019s log files (as .txt files)<\/li>\n\n\n\n<li>Where the default trace (.trc) files are located<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png\" alt=\"ErrorLogFileName\" style=\"aspect-ratio:2.805263157894737;width:533px;height:auto\" title=\"ErrorLogFileName\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Arguably, there are better ways to retrieve some of this information (like SELECT * FROM <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/hh204561.aspx\" target=\"_blank\" rel=\"noopener\">sys.dm_server_registry<\/a>;).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But <code>SERVERPROPERTY(\u2018ErrorLogFileName\u2019)<\/code> works just fine when looking for low-level details.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 \u2018search\u2019 for (i.e., \u2018ErrorLogFileName\u2019) \u2013 which is part of why I\u2019ve blogged about it (so that I\u2019ll be able to more easily find this snippet in the future).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While there are tons of undocumented T-SQL commands out there, one of my all-time favorites is this little gem: It\u2019s not much, but it will show you default details on: &nbsp;Arguably, there are better ways to retrieve some of this information (like SELECT * FROM sys.dm_server_registry;). But SERVERPROPERTY(\u2018ErrorLogFileName\u2019) works just fine when looking for low-level [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Favorite Undocumented T-SQL Snippet - OverAchiever<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Favorite Undocumented T-SQL Snippet - OverAchiever\" \/>\n<meta property=\"og:description\" content=\"While there are tons of undocumented T-SQL commands out there, one of my all-time favorites is this little gem: It\u2019s not much, but it will show you default details on: &nbsp;Arguably, there are better ways to retrieve some of this information (like SELECT * FROM sys.dm_server_registry;). But SERVERPROPERTY(\u2018ErrorLogFileName\u2019) works just fine when looking for low-level [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15\" \/>\n<meta property=\"og:site_name\" content=\"OverAchiever\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-07T16:12:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-05T16:14:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png\" \/>\n<meta name=\"author\" content=\"overachiever\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@angrypets\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"overachiever\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15\"},\"author\":{\"name\":\"overachiever\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/#\\\/schema\\\/person\\\/c9c91c14814950b22e1f013276ee5984\"},\"headline\":\"A Favorite Undocumented T-SQL Snippet\",\"datePublished\":\"2016-09-07T16:12:00+00:00\",\"dateModified\":\"2026-09-05T16:14:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15\"},\"wordCount\":146,\"image\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/3to9blog.overachiever.net\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/ErrorLogFileName_thumb.png\",\"articleSection\":[\"SQLServer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15\",\"url\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15\",\"name\":\"A Favorite Undocumented T-SQL Snippet - OverAchiever\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/3to9blog.overachiever.net\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/ErrorLogFileName_thumb.png\",\"datePublished\":\"2016-09-07T16:12:00+00:00\",\"dateModified\":\"2026-09-05T16:14:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/#\\\/schema\\\/person\\\/c9c91c14814950b22e1f013276ee5984\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#primaryimage\",\"url\":\"http:\\\/\\\/3to9blog.overachiever.net\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/ErrorLogFileName_thumb.png\",\"contentUrl\":\"http:\\\/\\\/3to9blog.overachiever.net\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/ErrorLogFileName_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?p=15#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Favorite Undocumented T-SQL Snippet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/#website\",\"url\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/\",\"name\":\"OverAchiever\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog-703f6.ingress-earth.ewp.live\\\/#\\\/schema\\\/person\\\/c9c91c14814950b22e1f013276ee5984\",\"name\":\"overachiever\",\"sameAs\":[\"https:\\\/\\\/www.overachiever.net\",\"https:\\\/\\\/x.com\\\/angrypets\"],\"url\":\"https:\\\/\\\/overachiever.blog\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Favorite Undocumented T-SQL Snippet - OverAchiever","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15","og_locale":"en_US","og_type":"article","og_title":"A Favorite Undocumented T-SQL Snippet - OverAchiever","og_description":"While there are tons of undocumented T-SQL commands out there, one of my all-time favorites is this little gem: It\u2019s not much, but it will show you default details on: &nbsp;Arguably, there are better ways to retrieve some of this information (like SELECT * FROM sys.dm_server_registry;). But SERVERPROPERTY(\u2018ErrorLogFileName\u2019) works just fine when looking for low-level [&hellip;]","og_url":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15","og_site_name":"OverAchiever","article_published_time":"2016-09-07T16:12:00+00:00","article_modified_time":"2026-09-05T16:14:34+00:00","og_image":[{"url":"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png","type":"","width":"","height":""}],"author":"overachiever","twitter_card":"summary_large_image","twitter_creator":"@angrypets","twitter_misc":{"Written by":"overachiever","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#article","isPartOf":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15"},"author":{"name":"overachiever","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/#\/schema\/person\/c9c91c14814950b22e1f013276ee5984"},"headline":"A Favorite Undocumented T-SQL Snippet","datePublished":"2016-09-07T16:12:00+00:00","dateModified":"2026-09-05T16:14:34+00:00","mainEntityOfPage":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15"},"wordCount":146,"image":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#primaryimage"},"thumbnailUrl":"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png","articleSection":["SQLServer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15","url":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15","name":"A Favorite Undocumented T-SQL Snippet - OverAchiever","isPartOf":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#primaryimage"},"image":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#primaryimage"},"thumbnailUrl":"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png","datePublished":"2016-09-07T16:12:00+00:00","dateModified":"2026-09-05T16:14:34+00:00","author":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/#\/schema\/person\/c9c91c14814950b22e1f013276ee5984"},"breadcrumb":{"@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#primaryimage","url":"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png","contentUrl":"http:\/\/3to9blog.overachiever.net\/wp-content\/uploads\/2016\/09\/ErrorLogFileName_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?p=15#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog-703f6.ingress-earth.ewp.live\/"},{"@type":"ListItem","position":2,"name":"A Favorite Undocumented T-SQL Snippet"}]},{"@type":"WebSite","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/#website","url":"https:\/\/blog-703f6.ingress-earth.ewp.live\/","name":"OverAchiever","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog-703f6.ingress-earth.ewp.live\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog-703f6.ingress-earth.ewp.live\/#\/schema\/person\/c9c91c14814950b22e1f013276ee5984","name":"overachiever","sameAs":["https:\/\/www.overachiever.net","https:\/\/x.com\/angrypets"],"url":"https:\/\/overachiever.blog\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/overachiever.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":1,"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":16,"href":"https:\/\/overachiever.blog\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/16"}],"wp:attachment":[{"href":"https:\/\/overachiever.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/overachiever.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/overachiever.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}