1 Reply Latest reply on Aug 23, 2013 5:30 AM by Frank Langelage

    SQL Exception: invalid object name for #temp table name inside a Stored Proc

    lichaochen Newbie

      We are in a process of converting a 10 years old JRun Web App to JBoss and are struggling with strange JDBC errors for all of our stored procedure calls that are using SQL local temp table. These SPs have been functioning in production for 5-10 years but under JBoss & sqljdbc4.jar we are getting SQL Exception for those SPs that are using #temp table.  Please help us if you know a way to resolve this problem.

      Here is the one of our stack traces:

      Invalid object name '#msgs'.

      1. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(): Line 216
      2. com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(): Line 1515
      3. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(): Line 404
      4. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(): Line 350
      5. com.microsoft.sqlserver.jdbc.TDSCommand.execute(): Line 5696
      6. com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(): Line 1715
      7. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(): Line 180
      8. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(): Line 155
      9. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(): Line 285
      • org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(): Line 462
      1. gov.ocda.cms2.control.violation.FormServlet.violationApproval(): Line 839
      2. gov.ocda.cms2.control.violation.FormServlet.doPost(): Line 72
      3. gov.ocda.cms2.core.CMSServlet.service(): Line 46
      4. javax.servlet.http.HttpServlet.service(): Line 847