SQL Server Performance

Importing from Excel to SQL server database

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by dream85, Jun 30, 2005.

  1. dream85 New Member

    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
  2. dineshasanka Moderator

    http://www.eggheadcafe.com/forums/ForumPost.asp?ID=23017&INTID=6
  3. satya Moderator

  4. dream85 New Member

    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?
  5. Madhivanan Moderator

  6. dream85 New Member

    how do i input ur codes in my asp.net page?
  7. Madhivanan Moderator

    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
  8. dream85 New Member

    what is the OPENROWSET?
    need to declare it first right?
  9. satya Moderator

    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.
  10. Madhivanan Moderator

  11. satya Moderator

  12. dream85 New Member

    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
  13. Madhivanan Moderator

    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
  14. ghemant Moderator

    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 />ghemant@gmail.com<br />"Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans" - by Hemant Goswami<br />

Share This Page