简体   繁体   English

将数据从Excel导入SQL Server 2008

[英]importing data from excel to SQL server 2008

I have the following problem 1-i have a database with a table called prod and 3 attributes Codep varchar (15) Namep varchar (40) and DateR datetime 2- I have a excel file with a sheet called prod and 3 columns with the same names of table columns(the first row have the columns names ) I have some info like 50 rows... 3 - when I try to import the excel data to SQL server 2008 it try to create a new table with the name prod$ I don't want that. 我有以下问题1-我有一个数据库,该数据库的表名为prod,并具有3个属性Codep varchar(15)Namep varchar(40)和DateR datetime 2-我有一个Excel文件,该表具有一个名为prod的工作表,并且3列具有相同的属性表列名称(第一行具有列名称)我有一些信息,例如50行... 3-当我尝试将excel数据导入SQL Server 2008时,它尝试创建名称为prod $的新表不想那样 I want import the data to my existing table prod no create a new one 我想将数据导入到现有表中,而不创建新表

What should I do to SQL import wizard recognize my excel sheet and insert the data into my table ? SQL导入向导应如何识别Excel工作表并将数据插入表中,该怎么办?

the wizard lets you choose the destination, just click on the drop down 该向导让您选择目的地,只需单击下拉菜单

在此处输入图片说明

Tutorial with screenshots 截图教程

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

Query: 查询:

SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\\test\\xltest.xls;Extended Properties=Excel 8.0')...[Customers$] 从OPENDATASOURCE中选择*进入XLImport3('Microsoft.Jet.OLEDB.4.0','数据源= C:\\ test \\ xltest.xls;扩展属性= Excel 8.0')... [Customers $]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM