{"id":2186,"date":"2024-02-02T07:00:00","date_gmt":"2024-02-02T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=2186"},"modified":"2024-02-01T23:38:57","modified_gmt":"2024-02-01T20:38:57","slug":"pos-kanoyme-mazika-detach-attach-vaseis-dedomeno","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno-2\/","title":{"rendered":"How to bulk detach \/ attach databases in SQL Server"},"content":{"rendered":"<p>Sometimes we will need to move databases to <strong>SQL Server<\/strong>. This process is also done with<strong> backup \/ restore<\/strong> either by changing the status of the base to <strong>offline <\/strong>in the article, however, we will deal with its procedures <strong>detach <\/strong>and <strong>attach<\/strong>. In the article we will see a script that creates the commands that complete this task.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">For what reasons it needs to be done<\/h2>\n\n\n\n<p>The usual reason is to <strong>we transfer <\/strong>base on a different one <strong>instance <\/strong>or even a different server. From there we can move the database files to a separate disk for performance and space reasons. Finally we can do <strong>attach <\/strong>a base on a newer version instance <strong>upgrading <\/strong>her.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What should we watch out for?<\/h2>\n\n\n\n<p>With this process we have some limitations. Let&#039;s analyze the most basic ones:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After transferring the bases, they should be created <strong>logins <\/strong>and connect to the users of each bases because you lose this connection during the transfer.<\/li>\n\n\n\n<li>His process <strong>attach <\/strong>is only done in an instance of the same version as the one that was done <strong>detach <\/strong>or younger<\/li>\n\n\n\n<li>If it becomes the base <strong>attach <\/strong>in a newer version the <strong>compatibility level <\/strong>does not itself change the execution of the command <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/statements\/alter-database-transact-sql-compatibility-level?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">alter database compatibility<\/a>.<\/li>\n\n\n\n<li>When we transfer a base it is not transferred as well <strong>jobs <\/strong>with it which are always stored in the system base <strong>msdb<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The process<\/h2>\n\n\n\n<p>The goal of the script is to generate the commands to do <strong>detach <\/strong>and <strong>attach<\/strong>. We execute orders <strong>detach <\/strong>in the <strong>instance <\/strong>with the bases we want to transfer. Once completed <strong>we transfer<\/strong> the database files. Finally we connect to <strong>instance <\/strong>that we want to attach and execute them <strong>attach <\/strong>commands.<\/p>\n\n\n\n<p>Example commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>EXEC sp_detach_db @dbname = 'db_test' , @skipchecks = 'true'; <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>EXEC sp_attach_db @dbname = 'db_test'     ,@filename1 = 'C:\\Program Files\\Microsoft SQL Server\\MSSQL15.SQL19\\MSSQL\\DATA\\ddd.mdf'     ,@filename2 = 'C:\\Program Files\\Microsoft SQL Server\\MSSQL15.SQL19\\MSSQL\\DATA\\fff_log.ldf' <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The script<\/h2>\n\n\n\n<p>Before its execution we will be able to define whether it will be done <strong>attach <\/strong>in the same drive as the parameter <em>@<strong>Drive_New<\/strong><\/em>, if we only want a specific base with the parameter <em>@<\/em><strong><em>dbname<\/em> <\/strong>and finally whether or not we want the system bases with the parameter <em>@<strong>whichdb<\/strong><\/em>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">USE [master];\nGO\nDECLARE @database NVARCHAR(200) ,\n    @cmd NVARCHAR(1000) ,\n    @detach_cmd NVARCHAR(4000) ,\n    @attach_cmd NVARCHAR(4000) ,\n    @file NVARCHAR(1000) ,\n    @i INT ,\n\t@whichdb INT=0,\n\t@dbname nvarchar(200)='%%',\n\t@Drive_Now nvarchar(10)='',\n\t@Drive_New nvarchar(10)='';\ncreate table #tempattach(attach_script varchar(max));\ncreate table #tempdetach(detach_script varchar(max));\n\n-- set 4 for only userdbs, 0 for all dbs \nset @whichdb  = 4\n\n--if u want to attach db on  new drive with same path uncomment with  the correct drive letters\n--set @Drive_Now = 'C:\\' set @Drive_New = 'Z:\\'\n\n--uncomment if u pick only one DBname\n--set @dbname = '%DBA%'\n\nDECLARE dbname_cur CURSOR STATIC LOCAL FORWARD_ONLY\nFOR\n    SELECT  RTRIM(LTRIM([name]))\n    FROM    sys.databases\n    WHERE   database_id > @whichdb\n\tand name like @dbname;\n\nOPEN dbname_cur\n\nFETCH NEXT FROM dbname_cur INTO @database\n\nWHILE @@FETCH_STATUS = 0 \n    BEGIN\n        SELECT  @i = 1;\n\n        SET @attach_cmd = \n            'EXEC sp_attach_db @dbname = ''' + @database + '''' + CHAR(10);\n      -- Change skip checks to false if you want to update statistics before you detach.\n        SET @detach_cmd =\n            'EXEC sp_detach_db @dbname = ''' + @database\n            + ''' , @skipchecks = ''true'';' + CHAR(10);\n\n      -- Get a list of files for the database\n        DECLARE dbfiles_cur CURSOR STATIC LOCAL FORWARD_ONLY\n        FOR\n            SELECT  physical_name\n            FROM    sys.master_files\n            WHERE   database_id = DB_ID(@database)\n            ORDER BY [file_id];\n\n        OPEN dbfiles_cur\n\n        FETCH NEXT FROM dbfiles_cur INTO @file\n\n        WHILE @@FETCH_STATUS = 0 \n            BEGIN\n                SET @attach_cmd = @attach_cmd + '    ,@filename'\n                    + CAST(@i AS NVARCHAR(10)) + ' = ''' + @file + ''''\n                    + CHAR(10);\n                SET @i = @i + 1;\n\n                FETCH NEXT FROM dbfiles_cur INTO @file\n            END\n\n        CLOSE dbfiles_cur;\n\n        DEALLOCATE dbfiles_cur; \n       insert into #tempattach values(REPLACE(@attach_cmd,@Drive_Now,@Drive_New));\n\t   insert into #tempdetach values(@detach_cmd);\n\n        FETCH NEXT FROM dbname_cur INTO @database\n    END\n\nCLOSE dbname_cur;\n\nDEALLOCATE dbname_cur; \n\nselect * from #tempdetach\nselect *  from #tempattach\n\ndrop table #tempattach\ndrop table #tempdetach<\/pre>\n\n\n\n<p>When we execute it, the commands for detach and attach of all bases will be produced:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"341\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/da-01.png\" alt=\"\" class=\"wp-image-2188\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/da-01.png 456w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/da-01-300x224.png 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Sources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/databases\/database-detach-and-attach-sql-server?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">Database Detach and Attach (SQL Server)<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Sometimes we will need to move databases to SQL Server. This process is also done with backup \/ restore or by changing the status of the base to offline, but in the article we will deal with the detach and attach processes. In the article we will see a script that creates the commands that complete this task. For [\u2026]<\/p>","protected":false},"author":1,"featured_media":702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[29,117,23,30,6],"class_list":["post-2186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","tag-databases","tag-detach-attach","tag-microsoft","tag-rdbms","tag-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr<\/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:\/\/www.dataplatform.gr\/en\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u039a\u03ac\u03c0\u03bf\u03b9\u03b5\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c7\u03c1\u03b5\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03bd\u03b1 \u03bc\u03b5\u03c4\u03b1\u03ba\u03b9\u03bd\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server. \u0391\u03c5\u03c4\u03ae \u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b3\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03ba\u03b1\u03b9 \u03bc\u03b5 backup \/ restore \u03b5\u03af\u03c4\u03b5 \u03b1\u03bb\u03bb\u03ac\u03b6\u03bf\u03bd\u03c4\u03b1\u03c2 \u03c4\u03bf status \u03c4\u03b7\u03c2 \u03b2\u03ac\u03c3\u03b7\u03c2 \u03c3\u03b5 offline \u03c3\u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03cc\u03bc\u03c9\u03c2 \u03b8\u03b1 \u03b1\u03c3\u03c7\u03bf\u03bb\u03b7\u03b8\u03bf\u03cd\u03bc\u03b5 \u03c4\u03b9\u03c2 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b5\u03c2 \u03c4\u03bf\u03c5 detach \u03ba\u03b1\u03b9 attach. \u03a3\u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03ad\u03bd\u03b1 script \u03c0\u03bf\u03c5 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03c4\u03b9\u03c2 \u03b5\u03bd\u03c4\u03bf\u03bb\u03ad\u03c2 \u03c0\u03bf\u03c5 \u03bf\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03bd\u03bf\u03c5\u03bd \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1. \u0393\u03b9\u03b1 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno-2\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-02T04:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\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.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \\\/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server\",\"datePublished\":\"2024-02-02T04:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/\"},\"wordCount\":52,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"keywords\":[\"Databases\",\"Detach \\\/ Attach\",\"Microsoft\",\"RDBMS\",\"SQL Server\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/\",\"name\":\"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \\\/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"datePublished\":\"2024-02-02T04:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft SQL Server\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/ms-sqlserver\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \\\/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","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.dataplatform.gr\/en\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno-2\/","og_locale":"en_US","og_type":"article","og_title":"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","og_description":"\u039a\u03ac\u03c0\u03bf\u03b9\u03b5\u03c2 \u03c6\u03bf\u03c1\u03ad\u03c2 \u03b8\u03b1 \u03c7\u03c1\u03b5\u03b9\u03b1\u03c3\u03c4\u03b5\u03af \u03bd\u03b1 \u03bc\u03b5\u03c4\u03b1\u03ba\u03b9\u03bd\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server. \u0391\u03c5\u03c4\u03ae \u03b7 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b1 \u03b3\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03ba\u03b1\u03b9 \u03bc\u03b5 backup \/ restore \u03b5\u03af\u03c4\u03b5 \u03b1\u03bb\u03bb\u03ac\u03b6\u03bf\u03bd\u03c4\u03b1\u03c2 \u03c4\u03bf status \u03c4\u03b7\u03c2 \u03b2\u03ac\u03c3\u03b7\u03c2 \u03c3\u03b5 offline \u03c3\u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03cc\u03bc\u03c9\u03c2 \u03b8\u03b1 \u03b1\u03c3\u03c7\u03bf\u03bb\u03b7\u03b8\u03bf\u03cd\u03bc\u03b5 \u03c4\u03b9\u03c2 \u03b4\u03b9\u03b1\u03b4\u03b9\u03ba\u03b1\u03c3\u03af\u03b5\u03c2 \u03c4\u03bf\u03c5 detach \u03ba\u03b1\u03b9 attach. \u03a3\u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03ad\u03bd\u03b1 script \u03c0\u03bf\u03c5 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03b5\u03af \u03c4\u03b9\u03c2 \u03b5\u03bd\u03c4\u03bf\u03bb\u03ad\u03c2 \u03c0\u03bf\u03c5 \u03bf\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03bd\u03bf\u03c5\u03bd \u03b1\u03c5\u03c4\u03ae \u03c4\u03b7\u03bd \u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1. \u0393\u03b9\u03b1 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno-2\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2024-02-02T04:00:00+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server","datePublished":"2024-02-02T04:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/"},"wordCount":52,"commentCount":0,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","keywords":["Databases","Detach \/ Attach","Microsoft","RDBMS","SQL Server"],"articleSection":["Databases","Microsoft SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/","url":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/","name":"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","datePublished":"2024-02-02T04:00:00+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/pos-kanoyme-mazika-detach-attach-vaseis-dedomeno\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.dataplatform.gr\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Microsoft SQL Server","item":"https:\/\/www.dataplatform.gr\/category\/databases\/ms-sqlserver\/"},{"@type":"ListItem","position":4,"name":"\u03a0\u03ce\u03c2 \u03ba\u03ac\u03bd\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac detach \/ attach \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd \u03c3\u03c4\u03bf\u03bd SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=2186"}],"version-history":[{"count":1,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2186\/revisions"}],"predecessor-version":[{"id":5654,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2186\/revisions\/5654"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/702"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=2186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=2186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=2186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}