Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Data from excel to sql server 2005

Latest post Thu, Jan 24 2008 9:33 AM by Will Riley. 5 replies.
  • Wed, Jan 23 2008 3:09 AM

    • kaak
    • Top 25 Contributor
    • Joined on Fri, Jan 18 2008
    • Edam, Netherlands
    • Posts 34
    • Points 613

    Data from excel to sql server 2005

    Is there a good site with example code for getting data from excel to sql server 2005....

    • Post Points: 21
  • Wed, Jan 23 2008 3:32 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Re: Data from excel to sql server 2005

    kaak

    It may be better to look for SQL forums of newsgroups to ask your question as likely they would be more likely to control this process.

    If I were needing to do this however, I would be attacking this as an import from Excel from inside SQL. I only use SQL 2000 so use the old DTS route which was easy, this has now changed in 2005, but shouldn't be too tricky.

    Maybe if you actually detail what you are trying to do, someone may be able to help here. (and if not, you can just cut and paste it to another forum)

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    Filed under: ,
    • Post Points: 21
  • Wed, Jan 23 2008 4:46 AM In reply to

    • Rob Bruce
    • Top 50 Contributor
    • Joined on Wed, Jan 9 2008
    • Llandrindod, Cymru/Wales
    • Posts 14
    • Points 167

    Re: Data from excel to sql server 2005

    Nick Hodge:

    Maybe if you actually detail what you are trying to do, someone may be able to help here. (and if not, you can just cut and paste it to another forum)

     

    Spot on. Without any details the only advice I could give is that there are hundreds of ways to do this of which two or three would be appropriate for any given circumstance.

    Cheers

    Rob ============================================ Siaradwch yn araf, os gwelwch'n dda - dim ond dysgwyr ydw i!

    • Post Points: 5
  • Wed, Jan 23 2008 8:59 AM In reply to

    • kaak
    • Top 25 Contributor
    • Joined on Fri, Jan 18 2008
    • Edam, Netherlands
    • Posts 34
    • Points 613

    Re: Data from excel to sql server 2005

    I'm importing data files into excel ( csv, txt and xml) and combining and modifying them.

    After some checks I want to write some of the data to an sql server 2005 database.

    Currently I'm using a linked access database but not proud of myself

    • Post Points: 37
  • Wed, Jan 23 2008 10:27 AM In reply to

    • XL-Dennis
    • Top 25 Contributor
    • Joined on Wed, Jan 9 2008
    • Östersund, Sweden
    • Posts 38
    • Points 650

    Re: Data from excel to sql server 2005

    Hi,

    Exporting data from Excel to a SQL Server 2005 includes:

    • Make sure that all data is well formated in the source worksheet(s)
    • Creating the connection string
    • Creating the SQL statement
    • Create the VBA code, including which db library to use (DAO or ADO)
    Which parts do You need help with and what additional information do we need to have?
     
    (I usually solve this kind of task by using managed COM add-ins where I use ADO.NET with VB.NET as the following case shows:
    Transfer Excel '07 data to SQL Server 2005 EE with ADO.NET But that another story) 

    With kind regards,
    Dennis W
    --------------------------------------------------------------
    My English Excel site My VSTO & .NET & Excel blog

    • Post Points: 5
  • Thu, Jan 24 2008 9:33 AM In reply to

    • Will Riley
    • Top 200 Contributor
    • Joined on Thu, Jan 17 2008
    • Sutton Coldfield, UK
    • Posts 1
    • Points 5

    Re: Data from excel to sql server 2005

    Or, as Nick alluded to, why not use an SSIS task (2005's replacement for DTS) to import the data? In fact, I would imagine that you could cut the Excel (and Access) stages out altogether and get the data directly from your CSV files, performing the necessary filters & transformations along the way.

    Kind regards, Will
    Filed under:
    • Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.