Hi All
In my script to a create table, how can check if the table exists? If the table exists, don't show any error message and don't try to create table
How come the following doesn't work?
Code:
if (not exists (select 1 from sysobjects where name="test" and type="U"))
begin
print "eeeeeeeeeeeeee"
create table test
(
test char(1) not null,
)
end
else
print "aaaaaaaaaa"
go
I get the following error message
"There is already an object named 'test' in the database"
Please help