Load Excel from Stored Procedure to SQLTable

  • How can I load an Excel file to a temporary table using a Stored Procedure instead of a DTS?

  • Research BOL for BCP should have what you need



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • EXEC sp_addlinkedserver 'ExcelSource',

    'Jet 4.0',

    'Microsoft.Jet.OLEDB.4.0',

    '\\xxx.xxx.xxx.xxx\ERP\inventory.xls',

    NULL,

    'Excel 8.0;HDR=YES;IMEX=1'

    EXEC sp_addlinkedsrvlogin 'ExcelSource', false, 'sa', 'pass', NULL

    insert into mytable

    SELECT

    AccGLBridgeOID) as AccGLBridgeOID,

    AccGLCode,

    AccGLFpaCode,

    AccGLFpaPerc,

    convert(int,AccGLXrePis) as AccGLXrePis,

    convert(int,ItemMarkOID)as ItemMarkOID,

    convert(int,NoteTypeOID) as NoteTypeOID

    FROM ExcelSource...sales$

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

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