Possible Duplicate:
Solutions for INSERT OR UPDATE on SQL Server
I am in a great trouble that I want write a SQL query that include a conditional statement.
EG : I have a SQL table with columns ID,NAME,STATUS
so before I insert value in to this table I want to check the name that is already exists in the table. If it is exist then I want to update the status value.
Is it possible to write the query by using queryString (SQL Server query instead of stored procedure) method, If anybody knw pls help me. I am using SQL Server 2008 R2