SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter PROCEDURE HR_Salary_SP_ChangeHistory
as
BEGIN
create table #detail(id int identity(1,1),ItemId int,ItemName varchar(255))
create table #detail1(id int identity(1,1),ItemFieldName nvarchar(255),ItemValue nvarchar(200))
create table #detail2(id int identity(1,1),ItemFieldName nvarchar(255),ItemValue nvarchar(200))
declare @oldDetailXml XML,@newDetailXml XML,@xmlValue XML
declare @count int,@index int,@rowCount int,@itemId int,@lastValue varchar(100),@itemName varchar(255),@ItemFieldName nvarchar(255),@oldValue nvarchar(200)
declare @xmlDetailValue varchar(max),@iType int,@oldXMLValue varchar(max),@newXMLValue varchar(max),@id int,@userId int
declare my_cursor cursor for
select pk_id,isnull(sSalaryItemXmls,'') as sSalaryItemXmls,itype,sOldS