Guest_imported
New member
- Jan 1, 1970
- 0
Well, the problem is: I run the statement below:
if not exists (select * from sysobjects where name = 'temptable')
BEGIN
create table temptable(name int)
END
ELSE
BEGIN
SELECT * FROM temptable
END
when I run it the first time, there are no problems, but the second time I run it, I receive the error:
Msg 2714, Level 16, State 1
There is already an object named 'temptable' in the database.
Is there a solution?
if not exists (select * from sysobjects where name = 'temptable')
BEGIN
create table temptable(name int)
END
ELSE
BEGIN
SELECT * FROM temptable
END
when I run it the first time, there are no problems, but the second time I run it, I receive the error:
Msg 2714, Level 16, State 1
There is already an object named 'temptable' in the database.
Is there a solution?