In a stored procedure, for the same table i want to UPDATE if exists else INSERT data. How ca this be implemented?
IF EXISTS(SELECT * FROM #Table WHERE id='211') BEGIN UPDATE #Table SET id = '200' WHERE (id='211') END ELSE BEGIN INSERT INTO #Table(id)VALUES('211') END
I want to update data from one table to another table with year condition. (OR) To Update one table based on another table using INNER JOIN