Don't create audit if only DTS changes for an item
Outlook Library
This commit is contained in:
@@ -1675,4 +1675,29 @@ from vefn_SiblingAndChildrenItems(@DocVersionList, @UnitPrefix) ZZ
|
||||
Join Contents CC on CC.ContentID=ZZ.ContentID
|
||||
where ZZ.ContentID in (select ContentID from vefn_FindText(@DocVersionList,@SearchString,@CaseSensitive,@IncludeLinks,@IncludeRtfFormatting,@IncludeSpecialCharacters,@StepTypeList))
|
||||
order by DvPath,OrdinalPath
|
||||
GO
|
||||
GO
|
||||
|
||||
/****** Object: Trigger [dbo].[tr_tblItems_Update] Script Date: 04/25/2012 14:09:52 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
/****** Object: Trigger [tr_tblItems_Update] ******/
|
||||
ALTER trigger [dbo].[tr_tblItems_Update] on [dbo].[tblItems] for update as
|
||||
begin
|
||||
if exists (select * from inserted)
|
||||
begin
|
||||
if update(PreviousID) or update(ContentID) or update(UserID) or update(DeleteStatus)
|
||||
begin
|
||||
insert into ItemAudits(ItemID,PreviousID,ContentID,DTS,UserID,DeleteStatus)
|
||||
select dd.ItemID,dd.PreviousID,dd.ContentID,dd.DTS,dd.UserID,dd.DeleteStatus from deleted dd
|
||||
inner join inserted ii on dd.ItemID = ii.ItemID
|
||||
where dd.deletestatus = 0 or ii.deletestatus != 0
|
||||
end
|
||||
end
|
||||
end
|
||||
GO
|
||||
-- Display the status of Trigger alter
|
||||
IF (@@Error = 0) PRINT 'Trigger alteration: tr_tblItems_Update Succeeded'
|
||||
ELSE PRINT 'Trigger alteration: tr_tblItems_Update Error on Alteration'
|
||||
GO
|
||||
|
Reference in New Issue
Block a user