wood burning stoves 2.0*
The moose likes JDBC and the fly likes sql server stored procedure issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "sql server stored procedure issue" Watch "sql server stored procedure issue" New topic
Author

sql server stored procedure issue

Meghana Meduri
Greenhorn

Joined: Mar 29, 2006
Posts: 27
Hi,

We are facing few problem with running a stored procedure through our java program in production. Same code works fine in all other environments (devl). even in production it works well except when there is lots of activity (Like some jobs trying to update database) going on in the database.

Exception we get is
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid column name:<column name>

The same procedures run within no time from Sql server console (not sure what our DBA is using).

Do you think of any reasons for invalid coulmn name exception for slow running queries?

your input would be a great help.
Thank you
Eric Gero
Ranch Hand

Joined: Jul 20, 2005
Posts: 73
Are you passing any parameters to the stored procedure? I have seen this happen when passing dynamically generated sql to a MS SQl server where the statement has an unmatched quote, or extra comma. The DBA should be able to profile the query to record what is actually being called.

Eric
Meghana Meduri
Greenhorn

Joined: Mar 29, 2006
Posts: 27
Yes, there are parameters passed to this procedure.
we also have this unmatched colon issue. But the error for that scenario is "Incorrect syntax".
We have three production servers and this invalid column exception is happening only in one server.
The classpath for All these server is same and also codebase. hence I don't see why this is happening on only one server.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: sql server stored procedure issue
 
Similar Threads
Need a disconnected resultset
PL/SQL PLS-00905 Object is invalid error
Problem calling IN parameters Stored Procedure from Java
How do I execute a SQL Server Stored Procedure with Hibernate?
Difference Between Named Queries and Stored Procedures