{"id":724,"date":"2012-10-30T21:32:32","date_gmt":"2012-10-30T11:32:32","guid":{"rendered":"http:\/\/www.moneystock.net\/wp_e\/?p=724"},"modified":"2012-11-01T21:47:36","modified_gmt":"2012-11-01T11:47:36","slug":"bulk-data-import-to-mssql","status":"publish","type":"post","link":"https:\/\/moneystock.net\/wp_e\/2012\/10\/30\/bulk-data-import-to-mssql\/","title":{"rendered":"Bulk data import to MSSQL"},"content":{"rendered":"<p>I was about to upload\u00a02 million\u00a0record of data using NHibernate&#8217;s default save method, which will transact every record\u00a0independently. It estimated almost 2 days to upload all data.<\/p>\n<p>In this mass data upload, bulk import utility, bcp is pretty useful. It takes 10 minutes for 2 million record to import.<\/p>\n<p>Related well written article.<\/p>\n<p>http:\/\/lostechies.com\/jimmybogard\/2010\/06\/24\/bulk-processing-with-nhibernate\/<\/p>\n<p>And sample console commands,<\/p>\n<p><strong>Example for importing CSV to SQL<\/strong><br \/>\nbcp [db name] in [absolute path to source file, e.g. CSV] -S [sever address] -t , -U [user id] -P [password] -f [absolute path to format file]<\/p>\n<p><strong>Creating Format File<\/strong><br \/>\nbcp [db name] format nul -f [format file name] -c -t , -S [server name] -U [user id] -P [password]<\/p>\n<p>-t , : define delimiter as &#8220;,&#8221;<\/p>\n<p>-f : format file is optional<\/p>\n<p>By utilizing format file, I could remove unwanted quotation (&#8220;&#8221;) from the value. Format file looks ugly but, it works and useful. Better to know it. Without understanding format file, it&#8217;s almost hard to import real work requirement.<\/p>\n<p>Tips: Be aware of line change types among windows, lynux and OS-X.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was about to upload\u00a02 million\u00a0record of data using NHibernate&#8217;s default save method, which will transact every record\u00a0independently. It estimated almost 2 days to upload all data. In this mass data upload, bulk import utility, bcp is pretty useful. It takes 10 minutes for 2 million record to import. Related well written article. http:\/\/lostechies.com\/jimmybogard\/2010\/06\/24\/bulk-processing-with-nhibernate\/ And&hellip; <a class=\"more-link\" href=\"https:\/\/moneystock.net\/wp_e\/2012\/10\/30\/bulk-data-import-to-mssql\/\">Continue reading <span class=\"screen-reader-text\">Bulk data import to MSSQL<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128],"tags":[],"class_list":["post-724","post","type-post","status-publish","format-standard","hentry","category-db","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/comments?post=724"}],"version-history":[{"count":5,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/posts\/724\/revisions"}],"predecessor-version":[{"id":729,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/posts\/724\/revisions\/729"}],"wp:attachment":[{"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/media?parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/categories?post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/moneystock.net\/wp_e\/wp-json\/wp\/v2\/tags?post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}