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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 ORDER BY clause in an Update Cursor

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-02-07 : 09:24:23
Jenifer Bond writes "Is it possible to use an ORDER BY Clause with an Update Cursor, see example below:

declare cust_cursor CURSOR FOR
select AccountNo+Surname from TmpDedup
WHERE (AccountNo <> '' and Surname <> '')
AND DedupedFlag=0
ORDER BY AccountNo+Surname
for update of TmpDedup.CustomerID, TmpDedup.DedupedFlag
etc..."

ClayG
Starting Member

13 Posts

Posted - 2003-02-11 : 18:04:09
I think you cannot update if you have order by.

Put "Type_Warning" in the declare cursor, then try static, keyset, dynamic . It tells you whats really going on. I think you will find keyset and dynamic get rejected, and that static cannot be updated.

Go to Top of Page
   

- Advertisement -