Ey,
I need to do few operations on every record in a table. Do I have to use cursor? Do SQL has something like 'FOR' or 'WHILE'? I've read somewere that cursors should be avoided due to their time consumption.
ThnxTell us what you need to do ... before we can comment on whether you need a cursor or not.
It would be helpful if you paste some DDL ... and sample data|||That was qucik :)
Im trying to write proc that would be run on a daily basis. It would have to deal with around 12000 records. What it has to do is to take data from flat, multicolumn table, check for some conditions and spread them into real relational db.
Lets say people input things into that flat table and they often misspell i.e. city names due to fast input. It gotta take a record, chceck if inserted city name exists in cities table in db, if not it goes to the missspelled names table and chcecks if it exists there, if not again it adds a new record to missspelled table and lights a flag to inform admin and he could make a decision if to move it to cities table or leave it in misspelled.
Same thing would happen for few columns in every row.
I hope I made myself clear enough...
Thnx again.
No comments:
Post a Comment