Host unlimited blogs, sites, forums for $4.95 only with this host

Recursive Update

Finding a good web host for your database sites is a big problem. Check our recommended host for database hosting or the datacenters with the most powerful and reliable dedicated servers suited for large databases.

This databases discussion was started by dwill on 30 October 2009

fast database hosting

I think i need a recursive update to do this (to avoid cursors) – but i am not sure if I can do that in SQL and/or if in fact it’s what I need to do!

The problem:

Table currently has the wrong values in a field and I need to update the entire table with the right values. The values depend on previous values in the table – like a running total for example (it’s actually a conditional total but I can handle that bit). So record X depends on the new value of all records before it being updated already – hence the idea of recursion.

I currently have a cusor solution that works, but it takes a long time to run as soon as I get to 50000+ rows – and I figure that there has to be a better way. Or maybe not?

The key issue is being able to run a single update that ‘knows’ what the new values are. I’m not sure replicating the code would help – the idea is simple enough and the code for my real example is long in the context it is in.

Learnmore Microsoft SQL Server databases hereShould you need to go for trustworthy hosting services for all database related sites, we suggest this host for virtual database hosting and this one for dedicated databases hosting

This entry was posted in Databases Bookmark this post and come back later for the best web hosting coupons.

This web hosting blog is proudly hosted with reliable Hostgator webhosting for only one cents through this hostgator coupon. If you're new here, you may want to subscribe to this web hosting RSS feed

-->