READ EXCEL DATA CELL BY CELL FROM SP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • T.S.Negi

    READ EXCEL DATA CELL BY CELL FROM SP

    HI,

    I HAVE AN EXCEL SHEET WITH SOME DATA, I WANT TO IMPORT THAT DATA (CELL
    BY CELL WITH MANIPULATION) INTO THE SQL SERVER TABLES BY USING STORED
    PROCEDURE(IF POSSIBLE).

    IF ANYBODY HAVE DONE SIMILER TYPE OF JOB OR KNOWING ABOUT IT, PLS. LET
    ME KNOW.

    THANKS IN ADV.

    T.S.NEGI
  • louis nguyen

    #2
    Re: READ EXCEL DATA CELL BY CELL FROM SP

    Wrap sql server with an object tag and create an instance for every
    spreadsheet you have. Seriously, save your spreadsheet as a CSV and
    use Bulk Insert. It's straight forward and can be found on the sql
    Books On Line Help. -- Louis

    Comment

    • T.S.Negi

      #3
      Re: READ EXCEL DATA CELL BY CELL FROM SP

      louisducnguyen@ hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0 311140737.280f0 fda@posting.goo gle.com>...[color=blue]
      > Wrap sql server with an object tag and create an instance for every
      > spreadsheet you have. Seriously, save your spreadsheet as a CSV and
      > use Bulk Insert. It's straight forward and can be found on the sql
      > Books On Line Help. -- Louis[/color]


      Louis thanks for your reply.

      But this does not seems to solve my problem.

      Bulk insert will not be right in this situation, coz. I have to
      manipulate data also.

      for example. if some record (id) already exist in data, in that case
      only updation may require.


      If I could read cell by cell data from excel sheet, then only this
      level of manipulation is possible.





      T.S.Negi

      Comment

      • Simon Hayes

        #4
        Re: READ EXCEL DATA CELL BY CELL FROM SP

        tilak.negi@mind-infotech.com (T.S.Negi) wrote in message news:<a1930058. 0311240332.35ae 29ef@posting.go ogle.com>...[color=blue]
        > louisducnguyen@ hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0 311140737.280f0 fda@posting.goo gle.com>...[color=green]
        > > Wrap sql server with an object tag and create an instance for every
        > > spreadsheet you have. Seriously, save your spreadsheet as a CSV and
        > > use Bulk Insert. It's straight forward and can be found on the sql
        > > Books On Line Help. -- Louis[/color]
        >
        >
        > Louis thanks for your reply.
        >
        > But this does not seems to solve my problem.
        >
        > Bulk insert will not be right in this situation, coz. I have to
        > manipulate data also.
        >
        > for example. if some record (id) already exist in data, in that case
        > only updation may require.
        >
        >
        > If I could read cell by cell data from excel sheet, then only this
        > level of manipulation is possible.
        >
        >
        >
        >
        >
        > T.S.Negi[/color]

        Probably the easiest approach is to BULK INSERT or DTS the spreadsheet
        into a staging table, then do an INSERT into the target table. That
        way you can check and clean up the data while it's in the staging
        table, and before it goes to the 'real' table.

        Simon

        Comment

        • louis nguyen

          #5
          Re: READ EXCEL DATA CELL BY CELL FROM SP

          > If I could read cell by cell data from excel sheet, then only this[color=blue]
          > level of manipulation is possible.[/color]

          If you're more comfortable doing arrays/loops, I don't think T-SQL has
          it. I would suggest bulk inserting into a temp table. Update
          (manipulate it). Identify new records and insert. Identify existing
          records and update.

          Comment

          Working...