Before anyone suggests a unique index or key, I have a very good case for this.
I am using this trigger, from Trigger to prevent Insertion for duplicate data of two columns:
CREATE TRIGGER LogDuplicates ON bkPersonPoints
FOR INSERT
AS
if exists (select * from bkPersonPoints c
inner join inserted i
on c.Name = i.Name and c.Points = i.Points)
begin
rollback
end
GO
That answer is accepted and has 15 up-votes, so I would expect it to work, yet even on my very first insert, into an empty table:
insert bkPersonPoints (Name, Points) values ('Brady', 100)
I get the error:
The transaction ended in the trigger. The batch has been aborted.
APPENDIX: The table looks like this:
CREATE TABLE [dbo].[bkPersonPoints](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NOT NULL,
[Points] [int] NOT NULL
) ON [APP_BR2_User]