Warning detected when optimizing SELECT INTO is treated as an error

Error constant SQLE_SELECT_INTO_WARNING_TREATED_AS_ERROR
ODBC 2 State ERROR
ODBC 3 State ERROR
Severity 16
SQLCODE –995
SQLSTATE WP016
Sybase error code 13495
Probable cause

The SELECT ... INTO #TEMPTABLE statement cannot proceed if a warning is detected while optimizing the query. To fix the problem, test the query by removing the INTO clause, and resolve the reported warning.