Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
--exec [balances_res_ie]
CREATE OR ALTER PROCEDURE dbo.balances_res_ie
AS
BEGIN
SET NOCOUNT ON;
declare @id int
declare @res_ie decimal(16,2)
DECLARE bn CURSOR
FOR
select convert(int,idifx), res_ie
from tabla_res_ie
order by convert(int,idifx)
OPEN bn
Fetch next from bn INTO @id, @res_ie
WHILE (@@FETCH_STATUS <> -1 )
BEGIN
if (@res_ie > 0)
begin
update balances_contables_new set res_otrosing = @res_ie
where idifx = @id
end
else
begin
update balances_contables_new set res_otrosegr = @res_ie * (-1)
where idifx = @id
end
Fetch next from bn INTO @id, @res_ie
END
CLOSE bn
DEALLOCATE bn
END
GO
GO
--exec [balances_res_ie]
CREATE OR ALTER PROCEDURE dbo.balances_res_ie
AS
BEGIN
SET NOCOUNT ON;
declare @id int
declare @res_ie decimal(16,2)
DECLARE bn CURSOR
FOR
select convert(int,idifx), res_ie
from tabla_res_ie
order by convert(int,idifx)
OPEN bn
Fetch next from bn INTO @id, @res_ie
WHILE (@@FETCH_STATUS <> -1 )
BEGIN
if (@res_ie > 0)
begin
update balances_contables_new set res_otrosing = @res_ie
where idifx = @id
end
else
begin
update balances_contables_new set res_otrosegr = @res_ie * (-1)
where idifx = @id
end
Fetch next from bn INTO @id, @res_ie
END
CLOSE bn
DEALLOCATE bn
END
GO
Depends On
1Used By
No items found