{"id":5244,"date":"2015-08-25T08:31:04","date_gmt":"2015-08-25T06:31:04","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/"},"modified":"2015-08-25T08:31:04","modified_gmt":"2015-08-25T06:31:04","slug":"sql-server-tips-logical-names-dont-match-with-physical-files-names","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/","title":{"rendered":"SQL Server Tips: Logical names don\u2019t match with physical files names"},"content":{"rendered":"<p>During a copy of a database from an environment to another (from Production to pre-production for instance), people usually don\u2019t changed the logical name of the data or log files when they rename the database and the physical file names.<\/p>\n<p>In my test environment, I create 2 copies of AdventureWorks and you can see that the logical name is the same for all three databases. <a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3119 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01.png\" alt=\"Logical_names_01\" width=\"300\" height=\"94\" \/><\/a><\/p>\n<p>I can choose 2 ways to detect if logical names are good or not.<br \/>\nThe first way is to compare the database name and the logical name.<br \/>\nThe second choice is to compare the logical name and the physical name.<br \/>\nI prefer the second, simply to have the same name between the file and its logical representation.<\/p>\n<p>To have just the database with the \u201cbad logical name\u201d, I create a where clause between the logical name and the physical name:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">mf.Physical_Name NOT LIKE '%'+mf.name+'%'<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_02.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3120 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_02.png\" alt=\"Logical_names_02\" width=\"300\" height=\"100\" \/><\/a><\/p>\n<p>To isolate the file name from the full path name, I use this query:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1))<\/pre>\n<p><em>\u00a0<\/em><\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_03.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3121 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_03.png\" alt=\"Logical_names_03\" width=\"300\" height=\"98\" \/><\/a><\/p>\n<p>But with this query, I have the extension file .mdf, .ldf, \u2026.<br \/>\nTo have the new logical name, I remove the extension file from my previous query. To do this, I use the length of the file name:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">LEFT(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1)),LEN(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1))) - 4) as new__logical_name<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_04.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3122 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_04.png\" alt=\"Logical_names_04\" width=\"300\" height=\"121\" \/><\/a><\/p>\n<p>Cool, I have the logical name that I wanted!<br \/>\nThe next step is to create directly the change query.<br \/>\nTo change the logical name from a database, I use the query:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">ALTER DATABASE [database_name] MODIFY FILE (NAME=N'logical_name',NEWNAME=N'new_logical_name')<\/pre>\n<p><em>\u00a0<\/em><\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_05.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3123 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_05.png\" alt=\"Logical_names_05\" width=\"300\" height=\"93\" \/><\/a><\/p>\n<p>I have now the modified script. I copy these queries in a new query window and run it:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_06.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3124 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_06.png\" alt=\"Logical_names_06\" width=\"300\" height=\"80\" \/><\/a><\/p>\n<p>This operation is ONLINE and is fast.<br \/>\nMsdn reference: <a title=\"MSDN link to ALTER Database\" href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb522469.aspx\" target=\"_blank\">https:\/\/msdn.microsoft.com\/en-us\/library\/bb522469.aspx<\/a><\/p>\n<p>I restart my query to detect if the change is done:<\/p>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_07.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-3125 aligncenter\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_07.png\" alt=\"Logical_names_07\" width=\"300\" height=\"157\" \/><\/a><\/p>\n<p>Here is the query to copy:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">SELECT db.name AS database_name, mf.name as actual_logical_name,\n\nLEFT(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1)),\n\nLEN(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1))) - 4) as new__logical_name,\n\n'ALTER DATABASE ['+db.name +'] MODIFY FILE (NAME=N'''+ mf.name + ''',NEWNAME=N'''+\n\nLEFT(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1)),\n\nLEN(REVERSE(LEFT(REVERSE(mf.Physical_Name),CHARINDEX('\\', REVERSE(mf.Physical_Name), 1) - 1))) - 4) +''')' as change_script\n\nFROM sys.master_files mf INNER JOIN sys.databases db ON db.database_id = mf.database_id\n\nWHERE db.database_id&gt;4 AND mf.Physical_Name NOT LIKE '%'+mf.name+'%'<\/pre>\n<p>It is not an optimized query and it is not a performance issue to rename logical names, but just a good practice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During a copy of a database from an environment to another (from Production to pre-production for instance), people usually don\u2019t changed the logical name of the data or log files when they rename the database and the physical file names. In my test environment, I create 2 copies of AdventureWorks and you can see that&hellip;&nbsp;<\/p>\n","protected":false},"author":15,"featured_media":5252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[49,15],"class_list":["post-5244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","tag-microsoft","tag-migration"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL Server Tips: Logical names don\u2019t match with physical files names - dbi services | Blog<\/title>\n<meta name=\"description\" content=\"Change the logical name of the data or log files during a copy or refresh\" \/>\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-tips-logical-names-dont-match-with-physical-files-names\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server Tips: Logical names don\u2019t match with physical files names\" \/>\n<meta property=\"og:description\" content=\"Change the logical name of the data or log files during a copy or refresh\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services | Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-25T06:31:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1447\" \/>\n\t<meta property=\"og:image:height\" content=\"451\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Haby\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\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-tips-logical-names-dont-match-with-physical-files-names\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/\"},\"author\":{\"name\":\"St\u00e9phane Haby\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7980252d7d7a521e285e7c66114cf82a\"},\"headline\":\"SQL Server Tips: Logical names don\u2019t match with physical files names\",\"datePublished\":\"2015-08-25T06:31:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/\"},\"wordCount\":312,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Logical_names_01-1.png\",\"keywords\":[\"Microsoft\",\"Migration\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/\",\"name\":\"SQL Server Tips: Logical names don\u2019t match with physical files names - dbi services | Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Logical_names_01-1.png\",\"datePublished\":\"2015-08-25T06:31:04+00:00\",\"description\":\"Change the logical name of the data or log files during a copy or refresh\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Logical_names_01-1.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/Logical_names_01-1.png\",\"width\":1447,\"height\":451},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/sql-server-tips-logical-names-dont-match-with-physical-files-names\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Tips: Logical names don\u2019t match with physical files names\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\"},\"alternateName\":\"dbi Blog\",\"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\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\",\"name\":\"dbi services\",\"alternateName\":\"dbi\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialised in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7980252d7d7a521e285e7c66114cf82a\",\"name\":\"St\u00e9phane Haby\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/STH_web-min-scaled.jpg\",\"caption\":\"St\u00e9phane Haby\"},\"description\":\"St\u00e9phane Haby has more than 20 years of experience in Microsoft solutions, specializing in the installation, migration, best practices, and performance analysis of Microsoft SQL Server, as well as Microsoft Business Intelligence solutions (SharePoint, Office) and .NET development for the banking sector. A former Microsoft Most Valuable Professional (MVP) and early adopter of Microsoft Team System in France, he has authored several technical articles. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. His industry experience covers chemicals and pharma, banking, and financial services.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-haby\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL Server Tips: Logical names don\u2019t match with physical files names - dbi services | Blog","description":"Change the logical name of the data or log files during a copy or refresh","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-tips-logical-names-dont-match-with-physical-files-names\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server Tips: Logical names don\u2019t match with physical files names","og_description":"Change the logical name of the data or log files during a copy or refresh","og_url":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/","og_site_name":"dbi services | Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2015-08-25T06:31:04+00:00","og_image":[{"width":1447,"height":451,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png","type":"image\/png"}],"author":"St\u00e9phane Haby","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","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-tips-logical-names-dont-match-with-physical-files-names\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/"},"author":{"name":"St\u00e9phane Haby","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7980252d7d7a521e285e7c66114cf82a"},"headline":"SQL Server Tips: Logical names don\u2019t match with physical files names","datePublished":"2015-08-25T06:31:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/"},"wordCount":312,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png","keywords":["Microsoft","Migration"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/","url":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/","name":"SQL Server Tips: Logical names don\u2019t match with physical files names - dbi services | Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png","datePublished":"2015-08-25T06:31:04+00:00","description":"Change the logical name of the data or log files during a copy or refresh","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/04\/Logical_names_01-1.png","width":1447,"height":451},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/sql-server-tips-logical-names-dont-match-with-physical-files-names\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL Server Tips: Logical names don\u2019t match with physical files names"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/blog\/#organization"},"alternateName":"dbi Blog","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":"Organization","@id":"https:\/\/www.dbi-services.com\/blog\/#organization","name":"dbi services","alternateName":"dbi","url":"https:\/\/www.dbi-services.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialised in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7980252d7d7a521e285e7c66114cf82a","name":"St\u00e9phane Haby","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/STH_web-min-scaled.jpg","caption":"St\u00e9phane Haby"},"description":"St\u00e9phane Haby has more than 20 years of experience in Microsoft solutions, specializing in the installation, migration, best practices, and performance analysis of Microsoft SQL Server, as well as Microsoft Business Intelligence solutions (SharePoint, Office) and .NET development for the banking sector. A former Microsoft Most Valuable Professional (MVP) and early adopter of Microsoft Team System in France, he has authored several technical articles. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. His industry experience covers chemicals and pharma, banking, and financial services.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-haby\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/5244","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=5244"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/5244\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/5252"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=5244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=5244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=5244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}