如何从Excel文件将数据插入SQL表 [英] How To Insert Data into SQL Table from Excel File
问题描述
因为表的列与Excel工作表的列相似.我必须从网页浏览Excel(用于Path),然后将数据(Excel中的所有行)上传到指定的表中.
请提供适当的代码.
谢谢,我得到了解决方案40%.
我必须在SQL表中插入一个不在Excel中的附加列,其值是Constant(String)/类似于从Excel插入的所有相应行中的"Project A".
注意:我也在使用此代码
As the Column of Table is Similar to the Column of Excel Sheet. I have to Browse the Excel from web page (for Path) and upload the data (all the Rows in Excel) into the specified Table.
Please give the approprate Code.
Thank you I got Solution 40%.
I Have to Insert One Additional Column in SQL-Table which is not in Excel,the value is Constant(String)/Same like "Project A" in all corresponding rows that insert from Excel.
Note : I am also using this code
INSERT INTO MyTable (PriKey, Description)
SELECT ForeignKey, Description
FROM SomeView
设置一个附加的列类型",并插入一个常量值,例如"Project A".
可能像
uppose one additional Column Type and insert a constant value like "Project A".
It may be like
INSERT INTO MyTable (PriKey, Description,Type)
SELECT ForeignKey, Description
FROM SomeView + ...
请提供必要的解决方案.
Pankaj
Please provide necessary solutions.
Pankaj
推荐答案
您尝试过吗?甚至是Google?
我做了 ^ ],并将其作为第一个链接:如何将数据从Excel导入SQL Server [ ^ ]
如果需要更多内容,请遍历搜索结果.立即尝试!
Did you tried anthing for it? Even a Google?
I did this[^] and got this as first link:How to import data from Excel to SQL Server[^]
Go through search result if you need more. Try now!
这篇关于如何从Excel文件将数据插入SQL表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!