jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "sql server stored procedure issue" Watch "sql server stored procedure issue" New topic

sql server stored procedure issue

Meghana Meduri

Joined: Mar 29, 2006
Posts: 27

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.

Meghana Meduri

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.
I agree. Here's the link: http://aspose.com/file-tools
subject: sql server stored procedure issue
It's not a secret anymore!