Link to home
Start Free TrialLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

How to use a SQL statement to control a block of C# statements

Using the following statement:

            commandString = "IF NOT EXISTS(SELECT 1 FROM syscolumns WHERE name = 'SubCatID')"

Is there a way that I can use this partial statement to control C# statements that follow?  (kind of an IF followed by a block of C# statements).  I want to be able to alter a table to a new format if the table has not been altered before.  It's not a simple job, because I have to backup the old table data, delete the old table, create a new table and then restore some of the data.
ASKER CERTIFIED SOLUTION
Avatar of UnifiedIS
UnifiedIS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rmmarsh

ASKER

Thank you so much... that did it...