I am trying to turn this SQL example command into a C # SqlCommand:
if not exists (select column_name
from INFORMATION_SCHEMA.columns
where table_name = 'TotalHeals'
and column_name = '"+Healee+"')
alter table TotalHeals add +Healee+ int
What I have so far
// TO DO check to see if column exists instead of throwing error
cmd2 = new SqlCommand("ALTER TABLE TotalHeals ADD " + Healee + " INT",openCon);
cmd2.ExecuteNonQuery();
I am completely lost how to code the if not exists statement. Any help?