Nice find Jim...I guess it didn't turn up in my search since it has spaces in the "Suspected for DoubleEntry" part...I think that "fix" is still not all that great since it uses a lot of calls to the SQL LOWER() function which as I understand it shouldn't be necessary, since the Altiris DB should be case-insensitive. From conversations I had with some NS engineering guys a while back, when you use functions on a column it loses the benefit of any indexes on that data (I think I have that right). I updated it with the following and we have not seen the "DoubleEntry" errors in the last two days since making the change!
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_FindComputerSuspectedForDoubleEntry]
@IPAddress nvarchar(32) = '',
@Name nvarchar(512) = '',
@Domain nvarchar(512) = ''
AS
SELECT distinct cr.Guid from vComputerResource cr
join Inv_AeX_AC_Identification acid on cr.Guid = acid._ResourceGuid
join Inv_AeX_AC_TCPIP tcp on cr.Guid = tcp._ResourceGuid
where [IP Address] = @IPAddress and
([IP Address] = Name and (isnull(Domain, N'') = '') or
(
[Name] = @Name AND
isnull([Domain], N'') = @Domain AND
(Name = @Name OR Domain=@Domain)
)
)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO