问题
I have excel sheet and I have 5 columns all are of type VARCHAR's.
I have a Table called Details and has 5 columns all of type VARCHAR's.
I have to import the data from Excel to table every day.
I am manually copying the records from excel and pasting them into the sql table. This approach is easy and quick.
But I want to make it automated.
Can I do it through the coding by giving the location of Excel Sheet.
I am using SQL 2005 and Excel 2007.
Any suggestions or directions please.
Thank you.
回答1:
You can use Integration Services to import excel files automatically, here is a good example:
http://www.techrepublic.com/blog/datacenter/how-to-import-an-excel-file-into-sql-server-2005-using-integration-services/205
You can also use Import/Export Wizard within SQL Server 2005 as well, which does the same job and also allow you to save it as a SSIS package.
来源:https://stackoverflow.com/questions/5103994/import-from-excel-to-sql-table