Question on How to Import CSV file into SQL Express

Greeting,

Any comments would be welcome

Thanks a lot~





Answer this question

Question on How to Import CSV file into SQL Express

  • Archonn

    By the way,

    I am using Visual Studio 2005 and SQL Express 2005~

    how do I read the CSV file and put into SQL



  • Angusl

    PJ. van de Sande wrote:
    You must first read the CSV file into something like a DataSet. I you use a DataSet you can just update the DataSet to the database with the SqlDataAdapter class.

    If you also want to import the structure, then you need to generate DDL queries as well based on the CSV file.

    You can also import csv files with DTS or BCP.
    DTS is the easiest, BCP is the fastest (if you have really big files)
    Lookup DTS and BCP in BOL or take a look a this great DTS site: http://www.sqldts.com/.

    Thanks so much..I wonder is there any DDL sample or reference site

    I am stuck with the DDL ,and I got my CSV dataSet ready~



  • WastingBody

    Just look at the Transact-SQL Reference on MSDN: ALTER TABLE. Lookup the CREATE and ALTER statements.


  • ch

    Great...CREATE AND ALTER IS GOOD

    haha

    Thanks



  • Spenceee

    You must first read the CSV file into something like a DataSet. I you use a DataSet you can just update the DataSet to the database with the SqlDataAdapter class.

    If you also want to import the structure, then you need to generate DDL queries as well based on the CSV file.

    You can also import csv files with DTS or BCP.
    DTS is the easiest, BCP is the fastest (if you have really big files)
    Lookup DTS and BCP in BOL or take a look a this great DTS site: http://www.sqldts.com/.


  • Question on How to Import CSV file into SQL Express