I have a LeaveCounter
table like such :
Login | ActivityId | Value | Date
And when I load my page it fills it up with a new list, but I am looking for a way to avoid duplicate INSERTs.
Here is my SQL Server 2008 statement with the variables :
string sql = @"INSERT INTO LeaveCounter VALUES ('" + employees[y] + "', '" + ActivityId[z] + "', 0 , " + yearlist[i] + ")";
Or simply :
INSERT INTO LeaveCounter VALUES (LOGIN, ACTIVITYID, 0, DATE)
How may I alter this call to make it so that it won't insert twice a row such as :
chris | 2 | 0 | 2015
So that It will add any new members of my list and simply skip existing ones?