Note that there are some explanatory texts on larger screens.

plurals
  1. POImport Excel Spreadsheet Data to an EXISTING sql table?
    primarykey
    data
    text
    <p>I have a table called tblAccounts whose contents will come from an excel spreadsheet.</p> <p>I am using MS SQL Server 2008 (x64) on a Windows 8.1 (x64)</p> <p>I tried using the SQL Server Import/Export Wizard but there is no option to choose an existing table but only an option to create a new one.</p> <p>I tried using other methods such as OPENROWSETS</p> <pre><code>INSERT INTO tblAccount SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 12.0;Database=D:\exceloutp.xls','SELECT * FROM [Sheet1$]') </code></pre> <p>but gave me an error:</p> <pre><code>Msg 7308, Level 16, State 1, Line 1 OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode. </code></pre> <p>Some research told me that it occurred because of a 64bit instance of SQL server.</p> <p>The problem is that this excel data transfer to an SQL table must be accomplished using the SQL Import/Export Wizard only.</p> <p><strong>How can I import an excel spreadsheet to an existing SQL table without creating a new one?</strong></p> <p>Thanks!</p> <p><em>Some links I visited but was not able to help me resolve my problem:<br/> <a href="https://stackoverflow.com/questions/472638/how-do-i-import-an-excel-spreadsheet-into-sql-server">How do I import an excel spreadsheet into SQL Server?</a><br/> <a href="http://social.msdn.microsoft.com/Forums/sqlserver/en-US/94332e6b-a283-4c8c-b6bb-eb1345c99909/ole-db-provider-microsoftjetoledb40-cannot-be-used-for-distributed-queries-because-the" rel="nofollow noreferrer">Fix OLE DB error</a></em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload