Stored procedure if record exists then update <p>I'm trying to check if a record exists and then update it if it does</p> <p>Here is what I current have: (Which obviously does not work)</p> <pre><code> CREATE PROCEDURE dbo.update_customer_m @customer_id INT , @firstname VARCHAR(30) , @surname VARCHAR(30) , @gender VARCHAR(6) , @age INT , @address_1 VARCHAR(50) , @address_2 VARCHAR(50) , @city VARCHAR(50) , @phone VARCHAR(10) , @mobile VARCHAR(11) , @email VARCHAR(30) , AS IF EXISTS ( SELECT * FROM dbo.Customer WHERE CustID = @customer_id ) BEGIN UPDATE dbo.Customer SET Firstname = @firstname, Surname = @surname, Age = @age, Gender = @gender, Address1 = @address_1, Address2 = @address_2, City = @city, Phone = @phone, Mobile = @mobile, Email = @email WHERE CustID = @customer_id END </code></pre> <p>Is there a better way of doing this that works?</p>