Page 1 of 1

how to import excel file to MSSQL

Posted: Mon 25 Feb 2008 07:54
by firekiller15
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$]');

Posted: Mon 03 Mar 2008 17:07
by Antaeus
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.