--Declare your variables
declare @ssn varchar(9)
declare @id_user int
--Declare your Cursor
DECLARE MyCursor CURSOR FOR
select ssn,id_user from users where userid like '%588717fndjor645%'
OPEN MyCursor
--Get first Cursor Record...
FETCH NEXT FROM MyCursor INTO @ssn,@id_user
WHILE @@FETCH_STATUS = 0
BEGIN
select @id_user
update top (1) users set ssn = 'hello 2' where id_user = @id_user
FETCH NEXT FROM MyCursor INTO @ssn,@id_user
END
--Cleanup...
CLOSE MyCursor
DEALLOCATE MyCursor