1 Reply Latest reply on Sep 20, 2006 2:45 PM by paross1

    Importing excel file to SQL Server

    ceno77
      I have an application that needs to import an excel file with 10 columns of data into an SQL Server database table with 13 columns of data. Two of the 3 extra database columns are manditory, and I need to manipulate the values going in.

      I've determined the best method to do this using coldfusion is to import the excel file into a cvs file then use SQL to import the cvs file into SQL server. Does anyone know how to import an excel document into a cvs file using ColdFusion?

      Thanks!
        • 1. Re: Importing excel file to SQL Server
          paross1 Level 2
          A couple of things come to mind. You might consider using DTS to import your data directly into SQL Server from Excel, rather than putting ColdFusion in the middle. Or, you might consider creating a ColdFusion ODBC datasource out of your Excel file, use a cfquery to select the applicable data, then insert the data into SQL Server in a loop. Not very efficient, but it can be done.

          Phil