I'm inserting many records and i need to valid no any duplicate record in table
Then I write a SQL statement as below
if not exists(select * from Poll
where empno = @cEmpno and date = @dDate and
termid = @cTermID and key = @cKeyID)
insert into HrPoll (empno, date, termid, key) values
(@cEmpNo, @dDate, @cTermID, @cKeyID)
GO
Is it a good solution?
Thanks in advance.
Then I write a SQL statement as below
if not exists(select * from Poll
where empno = @cEmpno and date = @dDate and
termid = @cTermID and key = @cKeyID)
insert into HrPoll (empno, date, termid, key) values
(@cEmpNo, @dDate, @cTermID, @cKeyID)
GO
Is it a good solution?
Thanks in advance.