Q:

Verifing if text already exists

I have a sql table that saves a word and I need to check if that word already exists and I so, I should get a message saying that word already exists. 
Is it possible? If so how should I do it?
I will leave it down below myccode to add the word for the sql, but if you need something else I will provide you without any problem.
string conn = ConfigurationManager.ConnectionStrings["test"].ConnectionString;
 using (SqlConnection sqlConn = new SqlConnection(conn))
  {
   sqlConn.Open();
   string sqlQuery = @"INSERT INTO testetiposdestados(CDU_ESTADOS) VALUES(@estados)";
   SqlCommand SQLcm = new SqlCommand();
   SQLcm.Connection = sqlConn;
   SQLcm.CommandText = sqlQuery;
   SQLcm.CommandType = CommandType.Text;
   SQLcm.Parameters.AddWithValue("@estados", textBox1.Text);
   SQLcm.ExecuteNonQuery();
   sqlConn.Close();
}

I'm using c#

A:

You can use IF NOT EXIST statment like so 
IF NOT EXISTS (SELECT * FROM testetiposdestados 
   WHERE CDU_ESTADOS = @estados)
BEGIN
   INSERT INTO testetiposdestados(CDU_ESTADOS) VALUES(@estados)
END

Your query will become: 
string sqlQuery = 
  @"IF NOT EXISTS(SELECT * 
                    FROM testetiposdestados 
                   WHERE CDU_ESTADOS = @estados) 
    BEGIN 
      INSERT INTO testetiposdestados(CDU_ESTADOS) 
           VALUES (@estados) 
    END";

If it inserted successfully it means it was not present in the table already.

