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)
 update a row that is opened by a cursor

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2007-05-22 : 05:43:56
can i update 1 of the rows that the Cursor in a Stored Procedure is pointing on?

thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-22 : 05:59:59
Yes. There is even a template in QA. You can take a look at it.

in Query Analyzer, File - New, look under folder 'Using Cursor', 'Declare and using an UPDATE cursor'

Why do you need to do this ? Can't you use UPDATE command ?

UPDATE <table> set <column> = <value> where <condition>


KH

Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2007-05-22 : 06:08:17
will the row which is hold by the cursor updated if i will make an update query?
isnt the rows locked to update as long as the cursor is on it?

thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2007-05-22 : 06:15:51
thanks alot~!
i didnt know of that
learning something new every day!

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page
   

- Advertisement -