Solved

Automated Import of csv into SQL Server 2008 Express

Posted on 2009-04-06
2
1,057 Views
Last Modified: 2012-06-27
I have SQL Server 2008 installed. I generate a csv file everyday and I want this file to be imported into the a specific table in this database. I need for the data in the table to be overwritten by this import.

Any way to do this?
0
Comment
Question by:ralphcarter2008
2 Comments
 
LVL 18

Expert Comment

by:jmoss111
ID: 24082799
Is the SQL table in the same format as the .csv? You can use a TRUNCATE TABLE and a BULK INSERT to push the file.
0
 
LVL 25

Accepted Solution

by:
reb73 earned 500 total points
ID: 24082819
You can use BCP or the OPENDATASOURCE/OPENROWSET TSQL commands (using the Microsoft Jet 4.0 text driver to read this as a set based table) if the csv fles are available in a location that is accessible by the SQL Server Service..

See EE PAQ link below -

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_24098776.html?sfQueryTermInfo=1+10+csv+file+opendatasourc

 
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

776 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