Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
btrimpop
Posting Yak Master
214 Posts |
Posted - 2001-07-18 : 09:50:28
|
| I currently have a process I'm trying to rewrite that uses curse...uh cursors because it is a row based (yuk) processing routine. The problem is I can't think of anyway to switch it to set based and get rid of the curse...uh...cursors. Here's the thing. One table contains time sheet entries. Each entry needs to run through some pretty complex logic to turn it into a billable event if possible. Each entry can take vastly different routes through the logic based on lots and lots of business rules. The kicker is that one of processes involves a table that contains 0 to n rows of user entered where conditions (stored in a varchar, for example: activity='xyz' and department = '123' ). Each time entry has to be checked against these user entered where conditions (currently a dynamic sql statment is being built). If a row is returned by the dynamic sql statement the info returned is used in processing the time entry, if not the next user entered where clause is grabbed, an sql statement built and executed etc.Can anyone think of a way to do this that is not row based? I've benchmarked it using the curse...uh...cursors and simulating them using temp tables with single row selects and the curse...uh...cursors are faster in this row based system. Let me know if you need more detail.Thanks |
|
|
|
|
|