I have a table in which I am inserting the rows for the employee but next time when I want to insert row I don't want to insert again data for that employee just want to update with required columns if it exits there if not then create a new row
How can we do this in the SQL Server 2005?
I am using JSP.
My query is
String sql="insert into table1(id,name,itemname,itemcatName,itemQty)values('val1','val2','val3','val4','val5')";
If it's the first time then insert it into database else if exists update it
How to do?