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
 SQL Server Development (2000)
 positioned cursor update problem

Author  Topic 

Ali.M.Habib
Yak Posting Veteran

54 Posts

Posted - 2009-08-19 : 02:31:42
I get the following error when executing the code listed below. Any ideas what I'm doing wrong?

Server: Msg 16947, Level 10, State 1, Line 1093055397
No rows were updated or deleted.
The statement has been terminated.

(0 row(s) affected)

declare @d1 char(1)
declare cur1 cursor for
select col1 from tab1 where col2 = 1
open cur1
fetch next from cur1 into @d1
update tab1 set col1 = '1' where current of cur1
deallocate cur1

any help please

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-08-19 : 04:00:26
What are you trying to do?

Wont this work simply?

update tab1
set col1 = '1'
where col2=1

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -