Cursors In Sql Server 2008. If we open dynamic cursor, and after that we make changes in original data source i.e. The purpose for the cursor may be to update one row at a time or perform an administrative process such as sql server database backups in a sequential.

Insert @prices (taskkey, langkey, unitkey, price) select r.taskkey, l.langkey, r.unitkey, r.price. Overview there are many times we need to examine or even alter fields of certain records of a result set returned by a query. Sql server 2008 provides a minimal set of tools — cursors and while loops — to accomplish this task.