You can modify the stored procedure to validate the existance of the unit_name before inserting as below. Below code is not tested.
ALTER proc [dbo].[unit_ins](@vv unit_insert readonly)
as
begin
if not exists(select null from unit where unit_name in (select unit_name from @vv))
insert into unit(unit_name)
end
Regards, RSingh
No comments:
Post a Comment