Turn from: http://blog.163.com/hanjh_520/blog/static/2186737220100125245614/
-958 Temp table <table-name> already exists in session.
This statement tries to create a table with the name of is shown, but a temporary table with that name already exists. Only one temporary table and a given name can exist in a session.
Check the spelling of the name. If the name is spelled as your intended, check that a temporary table with the given name does not exist in the session. To review the names of temporary tables, query the Systabnames table as follows:
SELECT Dbsname, tabname from Sysmaster:systabnames
WHERE tabname = <table-name>
If The name exists, review this name by querying the Systables table in <dbsname>:
SELECT TabName from <dbsname>:systables
WHERE tabname = <table-name>
If The name does not exist in Systables ("No rows Found"), this table is a temporary table.
Solution
if exists (SELECT dbsname, tabname from sysmaster:systabnames WHERE tabname = <table-name>)
drop table <tabl e-name>;
End If