Unix Technical Forum

READ EXCEL DATA CELL BY CELL FROM SP

This is a discussion on READ EXCEL DATA CELL BY CELL FROM SP within the SQL Server forums, part of the Microsoft SQL Server category; --> HI, I HAVE AN EXCEL SHEET WITH SOME DATA, I WANT TO IMPORT THAT DATA (CELL BY CELL WITH ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:48 PM
T.S.Negi
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:48 PM
louis nguyen
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:55 PM
T.S.Negi
 
Posts: n/a
Default Re: READ EXCEL DATA CELL BY CELL FROM SP

louisducnguyen@hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0311140737.280f0fda@posting.google.c om>...
> 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



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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:55 PM
Simon Hayes
 
Posts: n/a
Default Re: READ EXCEL DATA CELL BY CELL FROM SP

tilak.negi@mind-infotech.com (T.S.Negi) wrote in message news:<a1930058.0311240332.35ae29ef@posting.google. com>...
> louisducnguyen@hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0311140737.280f0fda@posting.google.c om>...
> > 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

>
>
> 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


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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 07:55 PM
louis nguyen
 
Posts: n/a
Default Re: READ EXCEL DATA CELL BY CELL FROM SP

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


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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com