471,066 Members | 966 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Insert Excel Work Sheet to Existing SQL Table

112 100+
I have wko(Workorder) table exist in my ERP. Now i have some excel sheet that contains some new workorder(more than1000 Records). Now i need to insert all the records which present in the sheet to wko table. Please tell me how to insert multiple records from excel sheet.

Thanks
Mohammed
Aug 7 '07 #1
1 2863
I have wko(Workorder) table exist in my ERP. Now i have some excel sheet that contains some new workorder(more than1000 Records). Now i need to insert all the records which present in the sheet to wko table. Please tell me how to insert multiple records from excel sheet.

Thanks
Mohammed
You can open an excel sheet as a rowset using OPENROWSET
Expand|Select|Wrap|Line Numbers
  1. Insert into WKOTABLE
  2. SELECT *
  3. FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
  4. 'Excel 8.0;Database=C:\spreadsheetname.xls', 'SELECT * FROM [worksheetname$]')
  5.  
There are some limitations to this however. You must have local and exclusive access to the file from the SQL server. Meaning it must be directly accessible from the server and no one can have it open.
Aug 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by Allison Bailey | last post: by
12 posts views Thread by elziko | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.