I need to do something relatively simple…
I need to update a table using a cursor. (I may have to create a
stored procedure for doing this…)
I need to declare an update cursor, fetch the cursor and update the
data (and presumably close the cursor and de-allocate it…
The update query is as follows… Would anyone there know how to
declare the cursor for update and use it?
UPDATE A
SET A.Field1 =
(SELECT B.Field1
FROM B INNER JOIN A ON A.id = B.id)
I need to know how to declare the cursor and fetch it.
Can anyone give me an example of the code I need for the SQL Server?
Thanks!