{"id":4028,"date":"2023-06-16T07:00:00","date_gmt":"2023-06-16T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=4028"},"modified":"2024-01-08T02:36:47","modified_gmt":"2024-01-07T23:36:47","slug":"pos-mporoyme-na-ektelesoyme-pollapla-sql","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/","title":{"rendered":"How can we run multiple SQL Scripts in SQL Server from within Windows with batch script"},"content":{"rendered":"<p>In this article we will see an easy way to be able to run SQL Scripts in bulk in the <strong>SQL Server<\/strong> with batch script and keep separate results for each in<strong> CSV<\/strong>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The example<\/h2>\n\n\n\n<p>Let&#039;s say we have multiple scripts that we want to run in the database <em>AdventureWorks2019 <\/em>and some in <em>StackOverflow2013<\/em>. <\/p>\n\n\n\n<p>The only thing we need to have done as preparation is to have put each script in a folder that will have the name of the base we want to run in each case and to have named them with a number at the beginning so that they are in order:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"265\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-01.png\" alt=\"\" class=\"wp-image-4029\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-01.png 557w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-01-300x143.png 300w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><figcaption class=\"wp-element-caption\">01<\/figcaption><\/figure>\n\n\n\n<p>Inside the folder with the name of the base that contains the scripts, we also add the <strong>batch script<\/strong> (<em>sqlcmd_batch_script.cmd<\/em>) which we will see below what it should contain:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"264\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-02.png\" alt=\"\" class=\"wp-image-4036\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-02.png 558w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-02-300x142.png 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><figcaption class=\"wp-element-caption\">02<\/figcaption><\/figure>\n\n\n\n<p>In the first script for the example, we ask that it bring us the name of the server, the name of the database and the tables it contains:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"408\" height=\"172\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-03.png\" alt=\"\" class=\"wp-image-4031\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-03.png 408w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-03-300x126.png 300w\" sizes=\"auto, (max-width: 408px) 100vw, 408px\" \/><figcaption class=\"wp-element-caption\">03<\/figcaption><\/figure>\n\n\n\n<p>Now double click on the <strong>batch script<\/strong> (<em>sqlcmd_batch_script.cmd<\/em>) the command window will appear and we will see the scripts run one by one with <a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/tools\/sqlcmd-utility?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">sqlcmd<\/a>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"511\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-04.png\" alt=\"\" class=\"wp-image-4032\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-04.png 977w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-04-300x157.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-04-768x402.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><figcaption class=\"wp-element-caption\">04<\/figcaption><\/figure>\n\n\n\n<p>When completed we will see that in the same folder it will have exported to <strong>CSV <\/strong>separately the results for each:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"266\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-05.png\" alt=\"\" class=\"wp-image-4033\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-05.png 591w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-05-300x135.png 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><figcaption class=\"wp-element-caption\">05<\/figcaption><\/figure>\n\n\n\n<p>If we open the first CSV with the results of the first script, we will see that it saved us the results of the select we requested with the server name, the base name and the tables it contains:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"974\" height=\"576\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-06.png\" alt=\"\" class=\"wp-image-4034\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-06.png 974w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-06-300x177.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2021\/11\/asms-06-768x454.png 768w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><figcaption class=\"wp-element-caption\">06<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The code<\/h2>\n\n\n\n<p>Let&#039;s now see step by step what it should contain <strong>batch script<\/strong> (<em>sqlcmd_batch_script.cmd<\/em>) and what parameters we set.<\/p>\n\n\n\n<p>For starters, we keep it <strong>full path<\/strong> for each file in the folder and set the variable <em>dbname <\/em>to get the name of the folder (which will be the same as the name of the base we want it to run):<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>CD \/d \"%~dp0\"\n\nfor %%I in (.) do set dbname=%%~nI\n<\/code><\/pre>\n\n\n\n<p>Then we define the type of file we want to export the results and the <strong>delimiter <\/strong>which we want it to have. In our case, we choose <strong>CSV <\/strong>and <strong>comma <\/strong>for delimiter so that when we open it it is already divided into columns:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>set filetype=.csv\nset delimiter=,<\/code><\/pre>\n\n\n\n<p>In the next step, we define the name of the server with the door, the username and the password with which it will run (if we used Active Directory login, the user and pass parameters should have been removed):<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>set instance=SMATZOURANISLP,1433\nset user=stratos\nset pass=password<\/code><\/pre>\n\n\n\n<p>We can have a second instance in the script and it will run in the corresponding instance depending on the name of the database:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>set instance2=SMATZOURANISLP\\INSTANCE2,1533\nset user2=stratos\nset pass2=password<\/code><\/pre>\n\n\n\n<p>In this case we define when it will connect to the first instance and when to the second:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>IF \"%dbname%\"==\"StackOverflow2013\" GOTO instance1\nIF \"%dbname%\"==\"AdventureWorks2019\" GOTO instance1\n \n\nIF \"%dbname%\"==\"StackOverflow2016\" GOTO instance2\n\nGOTO End1<\/code><\/pre>\n\n\n\n<p>So accordingly it will go to the piece of code for instance1:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>:instance1\n\n\nfor %%G in (*.sql) do sqlcmd \/S \"%instance%\" \/d \"%dbname%\" -U \"%user%\" -P \"%pass%\" -i\"%%G\" -b -s\"%delimiter%\" -W -o \"%%G%filetype%\"\n\nGOTO End1<\/code><\/pre>\n\n\n\n<p>or instance2:<\/p>\n\n\n\n<pre class=\"wp-block-code\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>:instance2\n\nfor %%G in (*.sql) do sqlcmd \/S \"%instance2%\" \/d \"%dbname%\" -U \"%user2%\" -P \"%pass2%\" -i\"%%G\" -b -s\"%delimiter%\" -W -o \"%%G%filetype%\"\n\nGOTO End1\n\n\n:End1\n\npause<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The script code all together<\/h2>\n\n\n\n<p>In the end the <strong>batch script<\/strong> (<em>sqlcmd_batch_script.cmd<\/em>) should have this form:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" 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=\"\">CD \/d \"%~dp0\"\n\n\nfor %%I in (.) do set dbname=%%~nI\nset filetype=.csv\nset delimiter=,\n\n\nset instance=SMATZOURANISLP,1433\nset user=stratos\nset pass=password\n\n\nset instance2=SMATZOURANISLP\\INSTANCE2,1533\nset user2=stratos\nset pass2=password\n\n\n\nIF \"%dbname%\"==\"StackOverflow2013\" GOTO instance1\nIF \"%dbname%\"==\"AdventureWorks2019\" GOTO instance1\n \n\nIF \"%dbname%\"==\"StackOverflow2016\" GOTO instance2\n\n\nGOTO End1\n\n\n:instance1\n\n\nfor %%G in (*.sql) do sqlcmd \/S \"%instance%\" \/d \"%dbname%\" -U \"%user%\" -P \"%pass%\" -i\"%%G\" -b -s\"%delimiter%\" -W -o \"%%G%filetype%\"\n\nGOTO End1\n\n\n \n:instance2\n\nfor %%G in (*.sql) do sqlcmd \/S \"%instance2%\" \/d \"%dbname%\" -U \"%user2%\" -P \"%pass2%\" -i\"%%G\" -b -s\"%delimiter%\" -W -o \"%%G%filetype%\"\n\nGOTO End1\n\n\n:End1\n\npause<\/pre>\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\/tools\/sqlcmd-utility?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">sqlcmd Utility<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In this article we will see an easy way to be able to run SQL Scripts en masse in SQL Server with batch script and keep the results for each separately in CSV. The example Suppose we have multiple scripts that we want to run in the AdventureWorks2019 base and some in StackOverflow2013. The only think that [\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":[42,29,23,30,6,161],"class_list":["post-4028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","tag-automations","tag-databases","tag-microsoft","tag-rdbms","tag-sqlserver","tag-sqlcmd"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - 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-mporoyme-na-ektelesoyme-pollapla-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03ad\u03bd\u03b1\u03bd \u03b5\u03cd\u03ba\u03bf\u03bb\u03bf \u03c4\u03c1\u03cc\u03c0\u03bf \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03b5 batch script \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03ba\u03c1\u03b1\u03c4\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03be\u03b5\u03c7\u03c9\u03c1\u03b9\u03c3\u03c4\u03ac \u03c4\u03b1 \u03b1\u03c0\u03bf\u03c4\u03b5\u03bb\u03ad\u03c3\u03bc\u03b1\u03c4\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03ba\u03b1\u03b8\u03ad\u03bd\u03b1 \u03c3\u03b5 CSV. \u03a4\u03bf \u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1 \u0388\u03c3\u03c4\u03c9 \u03cc\u03c4\u03b9 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac scripts \u03c0\u03bf\u03c5 \u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5 \u03bd\u03b1 \u03c4\u03c1\u03ad\u03be\u03bf\u03c5\u03bd \u03c3\u03c4\u03b7 \u03b2\u03ac\u03c3\u03b7 AdventureWorks2019 \u03ba\u03b1\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03b1 \u03c3\u03c4\u03b7\u03bd StackOverflow2013. \u03a4\u03bf \u03bc\u03cc\u03bd\u03bf \u03c0\u03bf\u03c5 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/\" \/>\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=\"2023-06-16T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-07T23:36:47+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script\",\"datePublished\":\"2023-06-16T04:00:00+00:00\",\"dateModified\":\"2024-01-07T23:36:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/\"},\"wordCount\":80,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"keywords\":[\"Automations\",\"Databases\",\"Microsoft\",\"RDBMS\",\"SQL Server\",\"sqlcmd\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/\",\"name\":\"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"datePublished\":\"2023-06-16T04:00:00+00:00\",\"dateModified\":\"2024-01-07T23:36:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-mporoyme-na-ektelesoyme-pollapla-sql\\\/#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-mporoyme-na-ektelesoyme-pollapla-sql\\\/#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 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script\"}]},{\"@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 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - 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-mporoyme-na-ektelesoyme-pollapla-sql\/","og_locale":"en_US","og_type":"article","og_title":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - DataPlatform.gr","og_description":"\u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03ad\u03bd\u03b1\u03bd \u03b5\u03cd\u03ba\u03bf\u03bb\u03bf \u03c4\u03c1\u03cc\u03c0\u03bf \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03bc\u03b1\u03b6\u03b9\u03ba\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03b5 batch script \u03ba\u03b1\u03b9 \u03bd\u03b1 \u03ba\u03c1\u03b1\u03c4\u03ae\u03c3\u03bf\u03c5\u03bc\u03b5 \u03be\u03b5\u03c7\u03c9\u03c1\u03b9\u03c3\u03c4\u03ac \u03c4\u03b1 \u03b1\u03c0\u03bf\u03c4\u03b5\u03bb\u03ad\u03c3\u03bc\u03b1\u03c4\u03b1 \u03b3\u03b9\u03b1 \u03c4\u03bf \u03ba\u03b1\u03b8\u03ad\u03bd\u03b1 \u03c3\u03b5 CSV. \u03a4\u03bf \u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1 \u0388\u03c3\u03c4\u03c9 \u03cc\u03c4\u03b9 \u03ad\u03c7\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac scripts \u03c0\u03bf\u03c5 \u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5 \u03bd\u03b1 \u03c4\u03c1\u03ad\u03be\u03bf\u03c5\u03bd \u03c3\u03c4\u03b7 \u03b2\u03ac\u03c3\u03b7 AdventureWorks2019 \u03ba\u03b1\u03b9 \u03ba\u03ac\u03c0\u03bf\u03b9\u03b1 \u03c3\u03c4\u03b7\u03bd StackOverflow2013. \u03a4\u03bf \u03bc\u03cc\u03bd\u03bf \u03c0\u03bf\u03c5 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2023-06-16T04:00:00+00:00","article_modified_time":"2024-01-07T23:36:47+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script","datePublished":"2023-06-16T04:00:00+00:00","dateModified":"2024-01-07T23:36:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/"},"wordCount":80,"commentCount":0,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","keywords":["Automations","Databases","Microsoft","RDBMS","SQL Server","sqlcmd"],"articleSection":["Databases","Microsoft SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/","url":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/","name":"\u03a0\u03ce\u03c2 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","datePublished":"2023-06-16T04:00:00+00:00","dateModified":"2024-01-07T23:36:47+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pos-mporoyme-na-ektelesoyme-pollapla-sql\/#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-mporoyme-na-ektelesoyme-pollapla-sql\/#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 \u03bc\u03c0\u03bf\u03c1\u03bf\u03cd\u03bc\u03b5 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03ad\u03c3\u03bf\u03c5\u03bc\u03b5 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ac SQL Scripts \u03c3\u03c4\u03bf\u03bd SQL Server \u03bc\u03ad\u03c3\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 Windows \u03bc\u03b5 batch script"}]},{"@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\/4028","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=4028"}],"version-history":[{"count":2,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/4028\/revisions"}],"predecessor-version":[{"id":5647,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/4028\/revisions\/5647"}],"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=4028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=4028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=4028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}