declare @Pro_Id varchar(10)
declare @Emp_Name nvarchar(50)
declare @Value nvarchar(50)
set @Value = 'MM'
declare cur cursor for
select Pro_Id, Emp_Name from Table2
open cur
fetch next from cur into @Pro_Id,@Emp_Name
while @@fetch_status = 0
begin
if @Emp_Name = @Value
Update Table1 set Pro_Cost = Pro_Cost + 2000 where Pro_Id = @Pro_Id
fetch next from cur into @Pro_Id,@Emp_Name
end
close cur
deallocate cur