0

I have to import an csv file to SQL database table which already created (empty and has the same number of named columns). It would be great if you could suggest any tutorials or give some tips.

1
  • Which database are you using and which version? SQL Server 2008? Commented Feb 26, 2011 at 4:23

1 Answer 1

1

I assume you are using Microsoft SQL Server. Do you need to do this in a program or manually? There is a tutorial on using the bcp command for that, or alternatively a SQL command. If you need to parse the CSV file for your own code, see this previous SO question.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very much.Is there a different way to do this? My CSV file contains last column which is one of three words(insert,update or delete). According to this I need or insert CSV file to the datatable or update or delete records. And what is the best way to know what is the data("word") in this row in this column? Thank you in advance.
@RedHelen: You might need to load the CSV file into your program and then have that update the database. Look at the last link in my answer for directions on how to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.