{"id":204,"date":"2016-10-01T18:27:11","date_gmt":"2016-10-01T18:27:11","guid":{"rendered":"http:\/\/gearmage.com\/blog\/?p=204"},"modified":"2026-11-25T20:14:22","modified_gmt":"2026-11-25T20:14:22","slug":"save-csv-excels-to-a-database","status":"publish","type":"post","link":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/","title":{"rendered":"Save CSV and Excel attachments to a database"},"content":{"rendered":"\n<p>Do you get sales reports, price lists or order exports by email as CSV or Excel files? Mail Attachment Downloader can put their rows straight into a database table, each time a new file arrives.<\/p>\n<p>If the files don&#8217;t come by email yet, you can email them to a mailbox of your choice, from anywhere, and let the program pick them up.<\/p>\n<p>Version 4.0 has two ways to do it:<\/p>\n<ul>\n<li>The <strong>Store CSV \/ SQL<\/strong> step in a rule: you map each column of the file to a field, and write the SQL. It needs <strong><a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-server\">PRO Rules Server<\/a><\/strong>.<\/li>\n<li>The <strong>Parser<\/strong>: it finds the table for you, checks it, and writes the lines to a database. More on it <a href=\"#parser-way\">below<\/a>.<\/li>\n<\/ul>\n\n<h2>Before you start: a data source<\/h2>\n<p>The program talks to your database through ODBC: SQL Server, MySQL, PostgreSQL, Oracle, Access and others. Set up a data source once in <strong>Settings<\/strong> \u203a <strong>Sources<\/strong> \u203a <strong>Data Sources<\/strong>. Version 4.0 is 64-bit, so it needs your database&#8217;s 64-bit ODBC driver. The steps are in <a href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/\">Save emails and attachments to a database<\/a>.<\/p>\n<p>Then make the table the rows go into, for example <code>dbo.SalesLines<\/code> with the columns Description, Price and Quantity.<\/p>\n\n<h2>Step 1: A rule for the emails with the files<\/h2>\n<ol>\n<li>Open the <strong>PRO Rules<\/strong> tab. Click <strong>New rule&#8230;<\/strong>, or select a rule and click <strong>Edit<\/strong>.<\/li>\n<li>Under <strong>Which emails<\/strong>, add the conditions, for example <strong>From<\/strong> &#8216;fabrikam.example&#8217; and <strong>Subject<\/strong> &#8216;daily sales&#8217;.<\/li>\n<li>Under <strong>Save<\/strong>, set <strong>What to save<\/strong> to <strong>The attachments<\/strong> and pick the <strong>Save folder<\/strong>, for example <code>\\\\fileserver\\Finance\\Sales<\/code>. Under <strong>Only files of these types<\/strong>, type <code>.csv, .xlsx, .xls<\/code> in <strong>Other:<\/strong>.<\/li>\n<\/ol>\n\n<h2>Step 2: Add a Store CSV \/ SQL step<\/h2>\n<ol>\n<li>Click <strong>Add a step&#8230;<\/strong>, choose <strong>Data and fields<\/strong>, then <strong>Store CSV \/ SQL<\/strong>, and click <strong>Add<\/strong>.<\/li>\n<li>In <strong>Data source:<\/strong>, pick your data source. In <strong>Table:<\/strong>, pick the table, or type its name.<\/li>\n<\/ol>\n\n<h2>Step 3: Map the columns to fields<\/h2>\n<p>Under <strong>The file&#8217;s columns<\/strong>:<\/p>\n<ol>\n<li>Next to <strong>Sample file:<\/strong>, click <strong>Browse&#8230;<\/strong> and pick a CSV or Excel file like the ones you receive.<\/li>\n<li>Pick the <strong>Sheet:<\/strong> to read. A CSV file has one.<\/li>\n<li>If the file starts with a row of column titles, tick <strong>The first row has the column names<\/strong>.<\/li>\n<li>Click <strong>Read the columns<\/strong>. The columns are listed by name (or by cell, such as A1 and B1, when there are no titles).<\/li>\n<li>Tick <strong>Use<\/strong> for each column you want, and type the <strong>Field<\/strong> it goes into, in braces (the braces are needed): <code>{DESCRIPTION}<\/code>, <code>{PRICE}<\/code>, <code>{QUANTITY}<\/code>.<\/li>\n<\/ol>\n<p>Need only part of a cell? Click <strong>Pattern&#8230;<\/strong> next to the column. Does the table start lower down or further right in the sheet? Set <strong>Start row:<\/strong> and <strong>Start column:<\/strong> under <strong>More options<\/strong>.<\/p>\n\n<h2>Step 4: Write the SQL and test it<\/h2>\n<p>In <strong>SQL:<\/strong>, write the statement that adds one row. It runs once for each row of the file:<\/p>\n<p><code>INSERT INTO {TABLE_NAME} (Description, Price, Quantity) VALUES ({DESCRIPTION}, {PRICE}, {QUANTITY})<\/code><\/p>\n<p>Each field goes into the SQL as a value, so it needs no quotes. <code>{TABLE_NAME}<\/code> is the table you picked. Click <strong>Fields&#8230;<\/strong> to add the email&#8217;s own fields as well, such as <code>{EMAIL_FROM}<\/code>.<\/p>\n<p>Click <strong>Test with the sample file<\/strong>. It asks first, then inserts the sample file&#8217;s rows into the table. Check the table in your database, then click <strong>Save<\/strong>.<\/p>\n\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-db-csv-rows.jpg?w=840&#038;ssl=1\" alt=\"The Rule Editor with a Store CSV \/ SQL step: data source, table dbo.InvoiceLines, the sample file and sheet, The first row has the column names ticked, and four columns each with a field\"><figcaption>A Store CSV \/ SQL step: the table, the sheet, and the field each column goes into.<\/figcaption><\/figure>\n\n<p>That&#8217;s it. From now on, the rows of each matching file are added to the table. The <strong>Downloads<\/strong> tab shows each email and whether the step worked. Each email is handled once: its History keeps the same file from being loaded twice.<\/p>\n<p>Keep in mind that the step only adds rows. If you <strong>Redo<\/strong> an email, its rows are added again.<\/p>\n\n<h2 id=\"parser-way\">The Parser way: let it find the table<\/h2>\n<p>The <a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#parser-tables\">Parser<\/a>, new in 4.0, reads tables from Excel and CSV files, and from PDFs and HTML emails too. You don&#8217;t map cells or write SQL:<\/p>\n<ol>\n<li>On the <strong>Parser<\/strong> tab, click <strong>New parser<\/strong> and pick a few of the report emails as samples.<\/li>\n<li>Under <strong>Fields<\/strong>, the Parser finds the table and its columns, and shows the rows it read in each sample. You can also <strong>Describe the rows in words<\/strong>.<\/li>\n<li>Under <strong>Output<\/strong>, send the lines to a database, an <strong>Excel workbook<\/strong> or <strong>Google Sheets<\/strong>, one row per line.<\/li>\n<\/ol>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gearmage.com\/assets\/images\/4.0-parser-tables.jpg?w=840&#038;ssl=1\" alt=\"The Parser's Fields step: a table of description, quantity, unit and amount read from three supplier samples, with a check that the rows add up to the subtotal\"><figcaption>The Parser reads the table of each sample, and checks that the rows add up.<\/figcaption><\/figure>\n<p>Why use it:<\/p>\n<ul>\n<li>Processing an email again replaces its lines instead of adding them twice.<\/li>\n<li>It can check that the lines add up to the total, and hold a doubtful file for you to approve.<\/li>\n<li>It finds the table by its header row, and reads it from a PDF or an HTML email as well.<\/li>\n<\/ul>\n<p>The Parser comes with <strong><a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-parser\">PRO Parser<\/a><\/strong>, which writes to CSV, Excel and Google Sheets. Its <strong>SQL database<\/strong> output, and saving the lines to a database, need <strong><a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-server\">PRO Rules Server<\/a><\/strong>. See <a href=\"https:\/\/gearmage.com\/pro-parser.html\">PRO Parser<\/a>.<\/p>\n<p>Use <strong>Store CSV \/ SQL<\/strong> when the files are clean tables with fixed columns and you want your own SQL. Use the Parser when the layouts vary or you want checks.<\/p>\n\n<p><strong>Try it:<\/strong> <a href=\"https:\/\/gearmage.com\/maildownloader.html\">download Mail Attachment Downloader<\/a> and start with <a href=\"https:\/\/gearmage.com\/buymaildownloader.html#plan-free\">the free edition<\/a>, or <a href=\"https:\/\/gearmage.com\/buymaildownloader.html\">compare the PRO editions<\/a>, each with a 30-day money-back guarantee.<\/p>\n\n<h2>Related<\/h2>\n<ul>\n<li><a href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-a-database\/\">Save emails and attachments to a database<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#csv-excel\">Read Excel and CSV attachments<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/maildownloader_pro_features.html#parser-output\">Parser output: CSV, Excel, Google Sheets, a database and more<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/emails-to-database.html\">Save emails, files and invoice data to a database<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/emails-to-csvexcel.html\">Emails to CSV and Excel<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/extract-data-emails-attachments\/\">Extract data from emails and attachments<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/blog\/save-emails-and-attachments-to-folders\/\">Save emails and attachments to folders with PRO Rules<\/a><\/li>\n<li><a href=\"https:\/\/gearmage.com\/buymaildownloader.html\">Plans and prices<\/a><\/li>\n<\/ul>\n<p>Using version 3.x? See the <a href=\"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database-3x\/\">3.x version of this guide<\/a>.<\/p>\n<p><a href=\"https:\/\/gearmage.com\/contact.html\">Contact us<\/a> with any questions or suggestions about this post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.<\/p>\n","protected":false},"author":1,"featured_media":1242,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[121,4,6],"tags":[84,75,83,81,82],"class_list":["post-204","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-mad","category-tips","tag-database","tag-email","tag-email-attachment","tag-save-csv-to-database","tag-save-excel-to-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Save CSV and Excel attachments to a database - Gearmage Blog<\/title>\n<meta name=\"description\" content=\"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Save CSV and Excel attachments to a database - Gearmage Blog\" \/>\n<meta property=\"og:description\" content=\"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Gearmage Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-01T18:27:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-25T20:14:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1400\" \/>\n\t<meta property=\"og:image:height\" content=\"840\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"gearmage\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"gearmage\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/\"},\"author\":{\"name\":\"gearmage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\"},\"headline\":\"Save CSV and Excel attachments to a database\",\"datePublished\":\"2016-10-01T18:27:11+00:00\",\"dateModified\":\"2026-11-25T20:14:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/\"},\"wordCount\":923,\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1\",\"keywords\":[\"database\",\"email\",\"email attachment\",\"save csv to database\",\"save excel to database\"],\"articleSection\":[\"Databases and spreadsheets\",\"Mail Attachment Downloader\",\"Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/\",\"name\":\"Save CSV and Excel attachments to a database - Gearmage Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1\",\"datePublished\":\"2016-10-01T18:27:11+00:00\",\"dateModified\":\"2026-11-25T20:14:22+00:00\",\"description\":\"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1\",\"width\":1400,\"height\":840,\"caption\":\"The Rule Editor with a Store CSV \\\/ SQL step: data source, table dbo.InvoiceLines, the sample file and sheet, The first row has the column names ticked, and four columns each with a field\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/save-csv-excels-to-a-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Save CSV and Excel attachments to a database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"name\":\"Gearmage Blog\",\"description\":\"Email Processing Tools and Solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#organization\",\"name\":\"Gearmage\",\"url\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/gearmage.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1\",\"width\":240,\"height\":58,\"caption\":\"Gearmage\"},\"image\":{\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/gearmage.com\\\/blog\\\/#\\\/schema\\\/person\\\/c8728645787bff3555b5873b43161652\",\"name\":\"gearmage\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g\",\"caption\":\"gearmage\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Save CSV and Excel attachments to a database - Gearmage Blog","description":"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.","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:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/","og_locale":"en_US","og_type":"article","og_title":"Save CSV and Excel attachments to a database - Gearmage Blog","og_description":"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.","og_url":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/","og_site_name":"Gearmage Blog","article_published_time":"2016-10-01T18:27:11+00:00","article_modified_time":"2026-11-25T20:14:22+00:00","og_image":[{"width":1400,"height":840,"url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","type":"image\/jpeg"}],"author":"gearmage","twitter_card":"summary_large_image","twitter_misc":{"Written by":"gearmage","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#article","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/"},"author":{"name":"gearmage","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652"},"headline":"Save CSV and Excel attachments to a database","datePublished":"2016-10-01T18:27:11+00:00","dateModified":"2026-11-25T20:14:22+00:00","mainEntityOfPage":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/"},"wordCount":923,"publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"image":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","keywords":["database","email","email attachment","save csv to database","save excel to database"],"articleSection":["Databases and spreadsheets","Mail Attachment Downloader","Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/","url":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/","name":"Save CSV and Excel attachments to a database - Gearmage Blog","isPartOf":{"@id":"https:\/\/gearmage.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#primaryimage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","datePublished":"2016-10-01T18:27:11+00:00","dateModified":"2026-11-25T20:14:22+00:00","description":"Load the rows of CSV and Excel files you receive by email into SQL Server, MySQL or any ODBC database automatically.","breadcrumb":{"@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#primaryimage","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","width":1400,"height":840,"caption":"The Rule Editor with a Store CSV \/ SQL step: data source, table dbo.InvoiceLines, the sample file and sheet, The first row has the column names ticked, and four columns each with a field"},{"@type":"BreadcrumbList","@id":"https:\/\/gearmage.com\/blog\/save-csv-excels-to-a-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gearmage.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Save CSV and Excel attachments to a database"}]},{"@type":"WebSite","@id":"https:\/\/gearmage.com\/blog\/#website","url":"https:\/\/gearmage.com\/blog\/","name":"Gearmage Blog","description":"Email Processing Tools and Solutions","publisher":{"@id":"https:\/\/gearmage.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gearmage.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gearmage.com\/blog\/#organization","name":"Gearmage","url":"https:\/\/gearmage.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","contentUrl":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2016\/02\/cropped-cropped-GearMage.jpg?fit=240%2C58&ssl=1","width":240,"height":58,"caption":"Gearmage"},"image":{"@id":"https:\/\/gearmage.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/gearmage.com\/blog\/#\/schema\/person\/c8728645787bff3555b5873b43161652","name":"gearmage","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ca0fad01f9a63241bc21d4f1f44befe7c62e4ee3bb268fb1adaadc2e49ed0699?s=96&d=mm&r=g","caption":"gearmage"}}]}},"jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/gearmage.com\/blog\/wp-content\/uploads\/2026\/11\/4-0-db-csv-rows.jpg?fit=1400%2C840&ssl=1","_links":{"self":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":19,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":1393,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/posts\/204\/revisions\/1393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media\/1242"}],"wp:attachment":[{"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gearmage.com\/blog\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}