Moving Data From Excel to Temp Table

  • How can i move data from a Excel file to a Temp Table.

    I tried using DTS but no luck.

    Thanks

    George

  • Can you give more information about exactly what is failing?

    For example, are you using a SQL Task where you have a CREATE TABLE #TempTableName statement? Or it is failing when you use a DECLARE @TempTable table(@....) statement?

    Are you generating a local or global temp object?

    Did you remember to put the SQL task that produces the temp table object first and then add the task that will load it from Excel?

    Information like that would be helpful.  In general, using DTS to load data from Excel into a Database table is one of things that DTS is really good at so don't give up on it just yet.

  • Thanks Kaddie Abdul, It worked through DTS, Thanks. I first created the Temp table in query analyser and then used the DTS to populate the data into that Temp table. Thanks

  • Hi there,

    this is often very usefull for me

    SELECT * FROM OPENDATASOURCE(
     'Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\myexcelfile.xls;Extended Properties=Excel 8.0')...Sheet1$
    SELECT   *
    FROM  OPENDATASOURCE(
     'Microsoft.Jet.OLEDB.4.0',
     'Data Source="E:\myaccessfile.mdb";
     User ID=;Password='
    &nbsp...AccessTableName
    

    Regards,

     

    Hendrik

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply