0

Actually my issue is that, I have an Azure time trigger function that hitting an API on a daily basis and fetching data from that API and mapping that data through my model classes and inserting that data into my application database. So there are so many duplicate records in the database so how can prevent that duplicate records to be entered in my database using INstead Of Insert trigger. As much as I know Instead of Insert trigger use Views for working.

  • Postgres or SQL Server? Those are two very different database products –  Mar 20 '20 at 10:05
  • 2
    Don't use triggers for this. Use a unqiue key constraint or a primary key constraint – Nick.Mc Mar 20 '20 at 10:24
  • 1
    Or, if it's conditional, a filtered `UNIQUE INDEX`. A `TRIGGER` is the *last* place you should be doing this. – Thom A Mar 20 '20 at 10:25
  • As an intern you are expected to ask questions and you should expect to learn valuable information from the organization for which you intern. So start asking. And you can create instead-of triggers for a table - though you should fix your code / design not just attempt to ignore the problems it creates. – SMor Mar 20 '20 at 13:31

0 Answers0