Solved

how to import multiple CSV files in folder into SQL Server 2012

Posted on 2014-12-22
4
1,033 Views
1 Endorsement
Last Modified: 2016-02-15
I have SQL Server 2012.  I want to import about 350+ CSV files located in a local folder of SQL 2012 server.  I only need a one-time import at this time.  I am new to SQL Server 2012, but have researched my problem extensively with BCP, Bulk Insert, OPENROWSET, and SSIS. Please assist with the easiest way possible. Thank you.
1
Comment
Question by:blackcatkempo
  • 2
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 250 total points
ID: 40513267
Shove them in the same folder, then in SSIS use a For Each File Loop to loop through all files to set the source of a data pump, with the destination being the SQL table.

That assumes that the files are exactly the same schema, and they are inserting into the same SQL table.
1
 

Author Comment

by:blackcatkempo
ID: 40521278
Do you have a good tutorial to follow using Microsoft Visual Studio 2012 Shell (Integrated) SQL Server Data Tools   11.1.41025.0?
0
 
LVL 14

Assisted Solution

by:Vikas Garg
Vikas Garg earned 250 total points
ID: 40521726
Hi,

I think the following link would help you to implement the same.

http://www.mssqltips.com/sqlservertip/2874/loop-through-flat-files-in-sql-server-integration-services/
0
 

Author Closing Comment

by:blackcatkempo
ID: 40522593
Awesome when it finally worked!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now