I have a table in which I am inserting rows for employees, but the next time I want to enter a row, I only want to update with the necessary columns if it exits there; if not, I want to construct a new row.
How can we do this in SQL Server 2005?
My Query:
String sql="insert into table1(id,name,itemname,itemcatName,itemQty)values('val1','val2','val3','val4','val5')";
If it's first time then insert it into database else if exists update it. Can someone please help me with this?