I have been looking for a solution to best implement a do not insert if the line already exists. I've read a lot of answers which al differ in some way and it's a little above my level to make any sense.
For example the following post is the top result: SQL Server Insert if not exist But I cannot understand why the variables are used and how I define table1 and table2. Would somebody be able to explain this a litle further so that I can apply it to my situation?
In my example I have about 5 columns (Date, Number1, Number2, Text1, Text2) that I'd like to insert from table1 to table2, but only if the do not exist. Update is not necessary. (Therefore merge is out of the question)