IF EXISTS (SELECT * FROM TABLE_NAME WHERE id = ?) BEGIN --do what needs to be done if exists END ELSE BEGIN --do what needs to be done if not END