2015-12-29 108 views
-1

我們有一個超過500列的excel文件。我們必須將這個文件導入到MS SQL SERVER 2008表中。但它只接受255列。如何導入excel到sql server 2008?

任何人都可以提出一種方法來導入/複製excel數據到sql表嗎?

+0

https://www.devart.com/dbforge/sql/data-pump/ – Devart

+0

_what_恰好只接受255列嗎? SSIS導入嚮導? BCP?大容量插入?是什麼讓你想到這個?如果您遇到錯誤,請發佈。 –

+0

@Nick,當我將excel記錄導入到sql server時,它只取excel表格的前255列。而我的Excel表格包含超過500列。我也沒有發現任何錯誤。我只需要將Excel表格的所有列導入到sql表格(MS SQL Server 2008 R2)中。 – user3848036

回答

3
please go through below link and follow the steps 

    https://www.mssqltips.com/sqlservertutorial/203/simple-way-to-import-data-into-sql-server/ 

    While using the Import wizard, Click on Edit Mappings on the "Select Source Tables and Views" page of the wizard, check the Type, Nullable, and Size columns for each source column. And must and should mapping should be done properly 
+0

另外,爲了加強本教程,可以在官方文章msdn上閱讀:https://msdn.microsoft.com/de-de/library/ms140052(v=sql.120).aspx –

+0

它將適用於SQL Server 2008 r2? – user3848036

0

您是否嘗試批量插入?

您可以使用下面的批量插入命令將excel數據移動到SQL Server中。

BULK INSERT table_name FROM 'C:\Directory\excelfile.csv' WITH (FIELDTERMINATOR='\t',ROWTERMINATOR='\n', ROWS_PER_BATCH=10000) 
相關問題