Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Processing - one row at a time

Status
Not open for further replies.

JackR

IS-IT--Management
Jun 7, 2001
10
0
0
US
OK - I'm a bit of a newbie here...

I would like to 'process' a table - read a row at a time and INSERT or UPDATE a row in another table. In more practical terms - I have a denormalized table that allowed for 5 items, that now need to be put into a normalized child table. So, I wish to read a record (row) form the source table - and in this case create however of the possible 5 items into the corresponding normailized table, then read the next row in the source table...

In general, how would one accomplish this type of batch processing or programming flow in a SQL script?

Thanks
 
Well, if you want to do a row by row operation then
you need to use cursors
 
The fast option would be an UPDATE statment as:

UPDATE TblA Set ColumnA = Column1
From TblB
where A = B

The Slowest option would be to use a cursor.

AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top