Importing from Excel to SQL server database | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Importing from Excel to SQL server database

Hi all, Need some help in importing data from excel to be updated into the database (SQL Server)
using ASP.NET. Anyone has any good web to intro? Regards,
Dream85
http://www.eggheadcafe.com/forums/ForumPost.asp?ID=23017&INTID=6
Why not take help from DTS pacakge to import/export data from/to excel & sql server.
http://www.sqldts.com has good code examples in this regard. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
DTS Package is codes or a component? Actually it will be better to just have the vb codes.
anyone have the vb codes for the uploading from Excel to SQL Server?
Have you tried this?
http://sql-server-performance.com/forum/topic.asp?TOPIC_ID=8440
Madhivanan Failing to plan is Planning to fail
how do i input ur codes in my asp.net page?

I think using connection object, you can use that query
Dim Con
Set Con=Server.CreateObject("ADODB.Connection")
Con.Execute("yourExportQuery")
Madhivanan Failing to plan is Planning to fail
what is the OPENROWSET?
need to declare it first right?
http://www.databasejournal.com/features/mssql/article.php/3331881&e=10431 Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
quote:Originally posted by satya http://www.databasejournal.com/features/mssql/article.php/3331881&e=10431 Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Satya, the link does not work and display only blank page
Madhivanan Failing to plan is Planning to fail
Try thishttp://www.databasejournal.com/features/mssql/article.php/3331881 link. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
The method is using analyzer query to input the codes right? What about using vb codes?
I doing aspx pages and i need to extract the info from the excel spreadsheet and input all the info into SQL server tables which are already created
In VB you can use, con.Execute ("Insert into SQLServerTable(columns) Select columns from OpenRowset(‘Microsoft.Jet.OleDB.4.0′,’Excel 8.0;Database=Excelpath;HDR=Yes’,’Select * from [SheetName$]’)") where con is the connection object
Madhivanan Failing to plan is Planning to fail
Hi,<br /><br />In VB you can use,<br /><br />con.Execute ("Insert into SQLServerTable(columns) Select columns from OpenRowset(‘Microsoft.Jet.OleDB.4.0′,’Excel 8.0;Database=Excelpath;HDR=Yes’,’Select * from [SheetName$]’)")<br /><br />where con is the connection object<br /><br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail<br /></blockquote><br /><br />this is the same method in vb we use to do same task in asp .net ,i suggest you to refer <a href=’www.planet-source-code.com’ target=’_blank’ title=’www.planet-source-code.com’>www.planet-source-code.com</a> sure you will finde some very good piece of code .<br /><br />[<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br />regards.<br /><br /><br /><br />hsGoswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemant Goswami<br />
]]>