{"id":3775,"date":"2014-06-16T00:16:00","date_gmt":"2014-06-15T22:16:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/"},"modified":"2014-06-16T00:16:00","modified_gmt":"2014-06-15T22:16:00","slug":"sql-server-how-to-find-default-data-path","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/","title":{"rendered":"SQL Server: How to find the default data path?"},"content":{"rendered":"<p><img decoding=\"async\" class=\"blog-image aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\" alt=\"\" \/><\/p>\n<p>I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.<\/p>\n<h3>Search with SERVERPROPERTY<\/h3>\n<p>Since SQL Server 2012, we can use the parameter &#8220;InstanceDefaultDataPath&#8221; in the T-SQL command SERVERPROPERTY.<br \/>\nMore information on msdn <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ms174396(v=sql.110).aspx\">here<\/a>.<\/p>\n<h4>Test with SQL server 2008<\/h4>\n<p><a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath02.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath02.png\"><img decoding=\"async\" title=\"DefaultDataPath02.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath02.png\" alt=\"DefaultDataPath02.png\" \/><\/a><\/p>\n<h4>Test with SQL Server 2012<\/h4>\n<p><a title=\"DefaultDataPath01.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath01.png\"><img decoding=\"async\" title=\"DefaultDataPath01.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath01.png\" alt=\"DefaultDataPath01.png\" \/><\/a><\/p>\n<p>Notice that we did not retrieved any error number when the SQL Server 2008 command failed.<br \/>\nIt is very important to test if the returned path is NULL and not if we have an error number.<\/p>\n<h3>Search via registry key<\/h3>\n<p>To search this information in the registry, you need to have a registry path for the instance.<br \/>\nThe first step is to\u00a0look for\u00a0the default registry path. This information is available in the key:<\/p>\n<p><em><code>HKEY_LOCAL_MACHINE\/Software\/Microsoft\/Microsoft SQL Server\/Instance Names\/SQL<\/code><\/em><br \/>\n<a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath03.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath03.png\"><img decoding=\"async\" title=\"DefaultDataPath03.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath03.png\" alt=\"DefaultDataPath03.png\" \/><\/a><\/p>\n<p>You may have multiple instances, as shown in my lab screenshot above. The best way is to enumerate all instance keys and select the right one.<br \/>\nFor this, I have to create a temporary table and insert the instance name and the registry path in it.<br \/>\nThen, I have to select the registry path corresponding to the instance with @@SERVERNAME.<br \/>\nBe careful: With a default instance, @@SERVERNAME is the server name and in the registry, you have &#8220;MSSQLSERVER&#8221; as instance name.<\/p>\n<p><a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath04.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath04.png\"><img decoding=\"async\" title=\"DefaultDataPath04.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath04.png\" alt=\"DefaultDataPath04.png\" \/><\/a><\/p>\n<p>In this script, all cases are covered. The key to search the information is:<\/p>\n<p><em>HKEY_LOCAL_MACHINESoftwareMicrosoftMicrosoft SQL ServerMSSQLServerDefaultData<\/em><\/p>\n<h4>Test with SQL server 2005 via a default instance<br \/>\n<a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath06.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath06.png\"><img decoding=\"async\" title=\"DefaultDataPath06.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath06.png\" alt=\"DefaultDataPath06.png\" \/><\/a><\/h4>\n<h4>Test with SQL Server 2014<br \/>\n<a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath05.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath05.png\"><img decoding=\"async\" title=\"DefaultDataPath05.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath05.png\" alt=\"DefaultDataPath05.png\" \/><\/a><\/h4>\n<p>I added this method to the first method with SERVERPROPERTY:<br \/>\n<a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath07.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath07.png\"><img decoding=\"async\" title=\"DefaultDataPath07.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath07.png\" alt=\"DefaultDataPath07.png\" \/><\/a><\/p>\n<p>In my final script, I have added a <strong>DEBUG<\/strong> mode to get more information and display the SQL Server version, the detection mode, and the data path.<br \/>\nBut if the key does not exist, we have no error message, like in the previous search. In this case, we must search for another method.<\/p>\n<h3>Search within an existing user-database<\/h3>\n<div>If we have a user database, we can easily search within the path of an existing database.<\/div>\n<div><\/div>\n<div><a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath10.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath10.png\"><img decoding=\"async\" title=\"DefaultDataPath10.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath10.png\" alt=\"DefaultDataPath10.png\" \/><\/a><\/div>\n<div><\/div>\n<div>The path is in the physical name from the first database file. he view sys.database_files helps us find the path but returns the full path name of the data file.<\/div>\n<div><\/div>\n<div>We must only select the path prior to the file name. The query&#8230;<\/div>\n<p><code> REVERSE(STUFF(REVERSE(@default_data_path),1,CHARINDEX('',REVERSE(@default_data_path)),'')) <\/code><\/p>\n<p>&#8230;gives us the path from first character to the last &#8221;<\/p>\n<p>But what if it is a new instance and we have no user-database yet?<\/p>\n<h3>Search with the master database<\/h3>\n<p>The last possibility is to search for the physical name in the same way as for a user-database, but in this case for the master database.<br \/>\nThe only change is that I know the database this time, so I don&#8217;t need to search for\u00a0it.<br \/>\nI have completed my script with these 2 solutions:<br \/>\n<a title=\"DefaultDataPath11.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath11.png\"><img decoding=\"async\" title=\"DefaultDataPath11.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath11.png\" alt=\"DefaultDataPath11.png\" \/><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>You will find a summary in the table below for every SQL Server version<br \/>\n<a class=\"easyblog-thumb-preview\" title=\"DefaultDataPath12.png\" href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath12.png\"><img decoding=\"async\" title=\"DefaultDataPath12.png\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DefaultDataPath12.png\" alt=\"DefaultDataPath12.png\" \/><\/a><br \/>\nIn this script, we have 4 ways to find the default data path.<br \/>\nLogically, the 2 first ways are available for 99% of your instances &#8211; the first two should work in most cases.<br \/>\nWith just a couple of changes, we can have the script for the default log path.<br \/>\nPlease find\u00a0<strong>the script for the default data path <a href=\"http:\/\/dbi-services.com\/blog\/images\/easyblog_images\/88\/Final_Version_Default_Data_Path.zip\">here<\/a> and\u00a0the script for the default log path <a href=\"http:\/\/dbi-services.com\/blog\/images\/easyblog_images\/88\/Final_Version_Default_Log_Path.zip\">there<\/a>.<\/strong><br \/>\nIf you have any question or concerns, please feel free to contact me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods. Search with SERVERPROPERTY Since SQL Server 2012, we [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":3556,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[198],"tags":[49,51,265,54,434],"type_dbi":[],"class_list":["post-3775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-management","tag-microsoft","tag-sql-server","tag-sql-server-2008","tag-sql-server-2012","tag-sql-server-audit"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server: How to find the default data path? - dbi Blog<\/title>\n<meta name=\"description\" content=\"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server: How to find the default data path?\" \/>\n<meta property=\"og:description\" content=\"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-15T22:16:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"473\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Haby\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Haby\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/\"},\"author\":{\"name\":\"St\u00e9phane Haby\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\"},\"headline\":\"SQL Server: How to find the default data path?\",\"datePublished\":\"2014-06-15T22:16:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/\"},\"wordCount\":575,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\",\"keywords\":[\"Microsoft\",\"SQL Server\",\"SQL Server 2008\",\"SQL Server 2012\",\"SQL Server Audit\"],\"articleSection\":[\"Database management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/\",\"name\":\"SQL Server: How to find the default data path? - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\",\"datePublished\":\"2014-06-15T22:16:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\"},\"description\":\"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2022\\\/04\\\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg\",\"width\":473,\"height\":164},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-how-to-find-default-data-path\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server: How to find the default data path?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0bfb7484ae81c8980fc2b11334f803b\",\"name\":\"St\u00e9phane Haby\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g\",\"caption\":\"St\u00e9phane Haby\"},\"description\":\"St\u00e9phane Haby has more than ten years of experience in Microsoft solutions. He is specialized in SQL Server technologies such as installation, migration, best practices, and performance analysis etc. He is also an expert in Microsoft Business Intelligence solutions such as SharePoint, SQL Server and Office. Futhermore, he has many years of .NET development experience in the banking sector and other industries. In France, he was one of the first people to have worked with Microsoft Team System. He has written several technical articles on this subject. St\u00e9phane Haby is Microsoft Most Valuable Professional (MVP) as well as Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. He holds a Engineer diploma in industrial computing and automation from France. His branch-related experience covers Chemicals &amp; Pharmaceuticals, Banking \\\/ Financial Services, and many other industries.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-haby\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server: How to find the default data path? - dbi Blog","description":"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.","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:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server: How to find the default data path?","og_description":"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/","og_site_name":"dbi Blog","article_published_time":"2014-06-15T22:16:00+00:00","og_image":[{"width":473,"height":164,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg","type":"image\/jpeg"}],"author":"St\u00e9phane Haby","twitter_card":"summary_large_image","twitter_misc":{"Written by":"St\u00e9phane Haby","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/"},"author":{"name":"St\u00e9phane Haby","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b"},"headline":"SQL Server: How to find the default data path?","datePublished":"2014-06-15T22:16:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/"},"wordCount":575,"commentCount":1,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg","keywords":["Microsoft","SQL Server","SQL Server 2008","SQL Server 2012","SQL Server Audit"],"articleSection":["Database management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/","name":"SQL Server: How to find the default data path? - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg","datePublished":"2014-06-15T22:16:00+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b"},"description":"I have read a lot of SQL Server blog postings and articles in order to find the default data path. This post covers different SQL Server versions (SQL Server 2012, SQL Server 2014, SQL Server 2008, SQL Server 2005) and provides a generic script with different methods.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2e1ax_default_entry_SQLServer_20140326-103734_1.jpg","width":473,"height":164},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-how-to-find-default-data-path\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server: How to find the default data path?"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/d0bfb7484ae81c8980fc2b11334f803b","name":"St\u00e9phane Haby","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1123227ca39a5dca608c0f72d23cd1904fee29979749bbb3a485b9438436c553?s=96&d=mm&r=g","caption":"St\u00e9phane Haby"},"description":"St\u00e9phane Haby has more than ten years of experience in Microsoft solutions. He is specialized in SQL Server technologies such as installation, migration, best practices, and performance analysis etc. He is also an expert in Microsoft Business Intelligence solutions such as SharePoint, SQL Server and Office. Futhermore, he has many years of .NET development experience in the banking sector and other industries. In France, he was one of the first people to have worked with Microsoft Team System. He has written several technical articles on this subject. St\u00e9phane Haby is Microsoft Most Valuable Professional (MVP) as well as Microsoft Certified Solutions Associate (MCSA) and\u00a0Microsoft Certified Solutions Expert (MCSE) for SQL Server 2012. He is also Microsoft Certified Technology Specialist (MCTS) and Microsoft Certified IT Professional (MCITP) for SQL Server 2008 as well as ITIL Foundation V3 certified. He holds a Engineer diploma in industrial computing and automation from France. His branch-related experience covers Chemicals &amp; Pharmaceuticals, Banking \/ Financial Services, and many other industries.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-haby\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/3775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=3775"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/3775\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/3556"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=3775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=3775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=3775"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=3775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}