After I create the "test" table, I tried applying the code.
The screen prints aaaaaaaaa. However, before it prints aaaaaaaa, it also shows the error message that "test" table already exists error message (but eeeeeee doesn't get printed)
Is it possible to modify the code, so that it doesn't print the table already exists error message?
This is not a runtime error, this is a compilation error.
Try this ..
1. Make sure 'test' table does not exists on database initially.
2. Create a proc for this
CREATE PROC sp_tigers
if (not exists (select 1 from sysobjects where name="test" and type="U"))
create table test
test char(1) not null,
3. Once compiled you should be able run it any times, without that error ..