{"id":9690,"date":"2025-03-14T08:22:34","date_gmt":"2025-03-14T08:22:34","guid":{"rendered":"http:\/\/www.withdata.com\/blog\/?p=9690"},"modified":"2025-03-14T09:22:34","modified_gmt":"2025-03-14T09:22:34","slug":"append-csv-data-to-sql-server-table-via-command-line-on-linux","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/mssql-cmd\/append-csv-data-to-sql-server-table-via-command-line-on-linux.html","title":{"rendered":"Append CSV data to SQL Server table via command line on Linux"},"content":{"rendered":"<p>Want to append the data from  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comma-separated_values\">CSV<\/a>  file to the existing  <a href=\"https:\/\/www.microsoft.com\/en-us\/cloud-platform\/sql-server\">SQL Server<\/a>  table via command line on Linux (Ubuntu\/RedHat\/CentOS&#8230;)?<\/p>\n<p>Using <a href=\"https:\/\/www.withdata.com\/mssql-cmd\/\">mssql-cmd<\/a>, a Command-Line client for SQL Server, you can append CSV\/TSV\/TXT data into existing SQL Server  table easily and fast.<\/p>\n<p>Support Windows, Linux, and MacOS.<\/p>\n<p><a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\">Download mssql-cmd Linux version<\/a>  <a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/download_3.jpg\" alt=\"Download mssql-cmd\" width=\"80\" height=\"22\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dtv\" style=\"display: none;\"><br \/>\n<a href=\"\/down\/mssql-cmd.linux-386.zip\">mssql-cmd.linux-386.zip<\/a><br \/>\n<a href=\"\/down\/mssql-cmd.linux-amd64.zip\">mssql-cmd.linux-amd64.zip<\/a><br \/>\n<a href=\"\/down\/mssql-cmd.linux-arm64.zip\">mssql-cmd.linux-arm64.zip<\/a><br \/>\n<\/span><\/p>\n<p>No need to install SQL Server client library.<\/p>\n<p>Convenient to deploy to cloud. No need to run installation file, just uncompress and run, immediately.<\/p>\n<h2>Append CSV\/TSV\/TXT data to existing SQL Server  table via command line on Linux<\/h2>\n<p>1. In interactive mode:<\/p>\n<pre>\nmssql-cmd> load loadtype=append\n      > table=media_messages \n      > datafile=\/data\/media_messages.csv \n      > delimiter=, \n      > quote=\" \n      > header=y;\n<\/pre>\n<p>2. In batch mode:<\/p>\n<pre>\nmssql-cmd dsn=\"pan:withdata@192.168.0.102\/test\" task=load loadtype=append table=media_messages datafile=\/data\/media_messages.csv  delimiter=, quote=\" header=y quit=y\n<\/pre>\n<p>See <a href=\"https:\/\/www.withdata.com\/mssql-cmd\/load.html\">parameters detail<\/a>.<\/p>\n<hr style=\"clear: both;\" \/>\n<p><a href=\"https:\/\/www.withdata.com\/mssql-cmd\/\">More about mssql-cmd<\/a> &#8211; <a href=\"https:\/\/www.withdata.com\/mssql-cmd\/\">Command-Line client for SQL Server<\/a><\/p>\n<div id=\"download-bottom\" style=\"clear: both;\">\n<p>Download mssql-cmd Linux version<a href=\"#download-bottom\" onclick=\"dbv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/btn_download_green.png\" alt=\"Download mssql-cmd\" width=\"165\" height=\"50\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dbv\" style=\"display: none;\"><br \/>\n<a href=\"\/down\/mssql-cmd.linux-386.zip\">mssql-cmd.linux-386.zip<\/a><br \/>\n<a href=\"\/down\/mssql-cmd.linux-amd64.zip\">mssql-cmd.linux-amd64.zip<\/a><br \/>\n<a href=\"\/down\/mssql-cmd.linux-arm64.zip\">mssql-cmd.linux-arm64.zip<\/a><br \/>\n<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Want to append the data from CSV file to the existing SQL Server table via command line on Linux (Ubuntu\/RedHat\/CentOS&#8230;)? Using mssql-cmd, a Command-Line client for SQL Server, you can append CSV\/TSV\/TXT data into existing SQL Server table easily and fast. Support Windows, Linux, and MacOS. Download mssql-cmd Linux version mssql-cmd.linux-386.zip mssql-cmd.linux-amd64.zip mssql-cmd.linux-arm64.zip No need [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2556],"tags":[2557,73,34,2553,1321,2560],"class_list":["post-9690","post","type-post","status-publish","format-standard","hentry","category-mssql-cmd","tag-append","tag-command-line","tag-csv","tag-linux","tag-sql-server","tag-sql-server-append-csv"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=9690"}],"version-history":[{"count":4,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9690\/revisions"}],"predecessor-version":[{"id":27295,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9690\/revisions\/27295"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=9690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=9690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=9690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}