{"id":9441,"date":"2025-06-09T05:39:41","date_gmt":"2025-06-09T05:39:41","guid":{"rendered":"http:\/\/www.withdata.com\/blog\/?p=9441"},"modified":"2026-07-06T03:26:40","modified_gmt":"2026-07-06T03:26:40","slug":"upsert-sql-server-data-from-json","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/jsontomssql\/upsert-sql-server-data-from-json.html","title":{"rendered":"Upsert data from JSON file to SQL Server"},"content":{"rendered":"<p>Want to upsert data from JSON file to  <a href=\"https:\/\/www.microsoft.com\/en-us\/cloud-platform\/sql-server\">SQL Server<\/a> ?<\/p>\n<p>Upsert: inserts rows into a table if they do not already exist, or updates them if they do.<\/p>\n<p>Try Withdata <a href=\"https:\/\/www.withdata.com\/file-to-db\/\">FileToDB<\/a>, a desktop JSON to SQL Server converter for Windows, MacOS, and Linux, Upsert SQL Server from JSON , Easy and Fast.<\/p>\n<p><a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\">Download FileToDB<\/a>  <a href=\"#download-top\" onclick=\"dtv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/download_3.jpg\" alt=\"Download FileToDB\" width=\"80\" height=\"22\" style=\"max-width:100%;height:auto;\" \/><\/a> <span id=\"dtv\" style=\"display: none;\"><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=win64\">Windows 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=win32\">Windows 32 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=deb\">Linux .deb (For Debian, Ubuntu) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=rpm\">Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=pkg\">MacOS 64 bit<\/a><br \/>\n<\/span><\/p>\n<h2>Upsert data from JSON file to SQL Server<\/h2>\n<p> Choose SQL Server and logon.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/logon\/choose_sql-server_logon.png\" alt=\"convert JSON file to SQL Server table - Choose SQL Server and logon\" width=\"430\" height=\"442\" style=\"max-width:100%;height:auto;display:block;\" \/><\/p>\n<p> Click &#8220;Wizard &#8211; 1 File To 1 Table&#8221; at task dialog.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/task-window.png\" alt=\"convert JSON file to SQL Server table - task window\" width=\"722\" height=\"399\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p> Select the &#8220;JSON&#8221; file type.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/select-file-type-json.png\" ALT=\"Import file data to database table - select file type\" width=\"547\" height=\"236\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\"><\/p>\n<p>then show the wizard.<\/p>\n<h3>1. Open a JSON file.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/wizard-import-json-source-json.png\" alt=\"Upsert JSON data to SQL Server table - Open JSON\" width=\"724\" height=\"573\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h3>2. Select a table and config fields.<\/h3>\n<p>Set &#8220;Load Type&#8221; to &#8220;Upsert&#8221;, choice &#8220;By Key&#8221;.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/wizard-upsert-dest-table.png\" alt=\"Upsert JSON data to SQL Server table - select table\" width=\"722\" height=\"572\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h3>3. Preview data.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/wizard-import-preview-json.png\" alt=\"Upsert JSON data to SQL Server table - preview\" width=\"724\" height=\"573\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<h3>4. Upsert JSON data to SQL Server.<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/file-to-db\/wizard-import-convert-json.png\" alt=\"Upsert JSON data to SQL Server table - import\" width=\"724\" height=\"573\" style=\"max-width:100%;height:auto;display:block;\" loading=\"lazy\" decoding=\"async\" \/><\/p>\n<p>You can schedule and automate this converting task by: <\/p>\n<ol>\n<li><a href=\"https:\/\/withdata.com\/file-to-db\/cmd.html\" target=\"_blank\">Save session and create .bat (Windows) or .sh (Linux\/macOS) file for &#8220;JSON to SQL Server&#8221; conversion.<\/a><\/li>\n<li><a href=\"https:\/\/withdata.com\/dbtodb\/schedule-task.html\" target=\"_blank\">Set scheduled task for &#8220;JSON to SQL Server&#8221; conversion.<\/a><\/li>\n<\/ol>\n<hr style=\"clear: both;\" \/>\n<p><a href=\"https:\/\/www.withdata.com\/file-to-db\/\">More about FileToDB<\/a> &#8211; <a href=\"https:\/\/www.withdata.com\/blog\/tag\/sql-server-import-json\">JSON to SQL Server converter<\/a><\/p>\n<div id=\"download-bottom\" style=\"clear: both;\">\n<p>Download FileToDB<a href=\"#download-bottom\" onclick=\"dbv.style.display = 'block';\"><img decoding=\"async\" src=\"https:\/\/www.withdata.com\/images\/btn_download_green.png\" alt=\"Download FileToDB\" width=\"165\" height=\"50\" style=\"max-width:100%;height:auto;\" loading=\"lazy\" decoding=\"async\" \/><\/a> <span id=\"dbv\" style=\"display: none;\"><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=win64\">Windows 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=win32\">Windows 32 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=deb\">Linux .deb (For Debian, Ubuntu) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=rpm\">Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit<\/a><br \/>\n<a href=\"\/download.php?app=FileToDB&#038;ver=pkg\">MacOS 64 bit<\/a><br \/>\n<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Want to upsert data from JSON file to SQL Server ? Upsert: inserts rows into a table if they do not already exist, or updates them if they do. Try Withdata FileToDB, a desktop JSON to SQL Server converter for Windows, MacOS, and Linux, Upsert SQL Server from JSON , Easy and Fast. Download FileToDB [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1423],"tags":[1418,1321,428],"class_list":["post-9441","post","type-post","status-publish","format-standard","hentry","category-jsontomssql","tag-json","tag-sql-server","tag-upsert"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9441","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=9441"}],"version-history":[{"count":9,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9441\/revisions"}],"predecessor-version":[{"id":32749,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/9441\/revisions\/32749"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=9441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=9441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=9441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}