Categories
Development

Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object – SQL Server – simple table

I’ve had a look at some of the other answers to this kind of question, but as a beginner, they didn’t quite make sense. Could someone please advise what I’d need to change in the queries below to prevent the error Violation of PRIMARY KEY constraint ‘PK__Coding_I__C2232422662DE1EF’. Cannot insert duplicate key in object ‘dbo.Coding_Interview’. The […]

Categories
Development

function with 2 parameters without value

Is this function have any sense? if I didn’t define the value of p_var1[] and p_size? Just to know if it make sense, I have bigger code, but as a beginner, for me, if there is no values for these variables, that is weird. First function: int max1(int p_values[15][15]) { int max_value; for(int i=0; i […]