IF EXISTS(SELECT * FROM table WHERE id1 = @id) BEGIN -- do the update because you know it exists UPDATE Table SET field1 = @field1, etc. END ELSE BEGIN -- do an insert, because it does not exist INSERT INTO table ... END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)