I\'m trying to figure out the best way to insert a record into a single table but only if the item doesn\'t already exist. The KEY in this case is an NVARCHAR(400) field. Fo
declare @Error int
begin transaction
INSERT INTO Words (Word) values(@word)
set @Error = @@ERROR
if @Error <> 0 --if error is raised
begin
goto LogError
end
commit transaction
goto ProcEnd
LogError:
rollback transaction