Problem:
This particular error has been encountered when using local temporary tables in SQLServer with the COBOL programs which reference a database on a local SQLServer instance. When everything works correctly, the temporary table is created within tempdb and it is possible to carry out any operation on it whether it be DDL or DML.
However, if the same COBOL program references a database which is on a different instance (eg. servernt\\istanzaprova) it cannot correctly create the temporary table and, as a consequence, any DML operation (insert, update, select) returns the error sqlcode -208 Invalid object name.
Running the table create again you may encounter sqlcode -2714 There is already an object named '%.*ls' in the database.
Resolution:
In short, this problem is caused by a collation conflict between the database collation of the application and the tempdb collation of the instance in which the temporary tables are created.
The solution is the specify the "COLLATE ...." clause in the SQL instructions which concern objects which are found outside of the the database.




