The follow are the steps for what you want to achieve
1. Write a small stored procedure where you pass all the values to be inserted in the table.
2. Check count of lastname which matches with the lastname you have passed.
3. if count is 0 the insert the record
if you dont understand what I am trying to say then check the code below
create procedure CheckCountOfLastName(@name varchar(20), @lastname varchar(20))
as
declare @count numeric
select @count = count(lastname) from yourtablename where lastname=@lastname
if (@count = 0)
begin
insert into yourtablename(name, lastname) values(@name, @lastname)
end
Hope it helps