When an alter table, create table, or create view command occurs
within an if...else block, Adaptive Server creates the schema for the
table or view before determining whether the condition is true. This
may lead to errors if the table or view already exists.


how to rectify this problem?

example:

if(condition)
begin
alter table.........
end
else
do something....

end

it is giving error at the alter table statement.


please suggest the solution.