how to import excel file to MSSQL

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 1
Joined: Mon 25 Feb 2008 07:48

how to import excel file to MSSQL

Post by firekiller15 » Mon 25 Feb 2008 07:54

hi im using MSSQL and i want to import excel file to my MSSQL database below is my code but it just seems having alot of syntax error.Anyone ?? pls help

SQL.Add('SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0';Extended Properties=Excel 8.0')...[Customers$]');

Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 03 Mar 2008 17:07

Is it the problem with SQL, or your Delphi code is not compilable? If the problem is with Delphi code, check quotes in your query.

If you are getting errors related to SQL syntax from SQL Server, check this statement with a client tool like SQL Server Query Analyzer or SQL Server Management Studio.

Post Reply