Create PROCEDURE UpdateBankDate
as
begin
DECLARE @VoucherId int
DECLARE @BankDate datetime
DECLARE curNewList CURSOR
FAST_FORWARD
FOR
SELECT Voucher_Id,bank_date From DataTableVoucherBankDate
OPEN curNewList
FETCH NEXT FROM curNewList into @VoucherId, @BankDate
While @@FETCH_STATUS = 0
begin
UPDATE vouchers Set BankDate = @BankDate From DataTableVoucherBankDate
Where Vouchers.voucher_id = @VoucherId
FETCH NEXT FROM curNewList into @VoucherId, @BankDate
end
close curNewList
deallocate curNewList
No comments:
Post a Comment