2015-12-29 104 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) 
相关问题