I have the following sp which works:
USE [SIS]
GO
/****** Object: StoredProcedure [dbo].[update_dept_mstr] Script Date: 04/26/2011 12:15:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[update_dept_mstr] (@code char(2))
as
begin
set nocount on;
DECLARE @MyTableVar table(
NewLastReceipt char(6),
OldLastReceipt char(6)
);
update DM set LastReceipt = RIGHT( '0000000' + cast(cast(dm.LastReceipt as int) + 1 as varchar(10)), 6)
OUTPUT INSERTED.LastReceipt,
DELETED.LastReceipt
into @MyTableVar
from dbo.DEPT_MSTR dm
where Code = @code
select *
from @MyTableVar
end
I just want to know if this can be done with pure llbl code. The cool part is that it outputs the value after the update is made.
Thanks,
Fishy