Problem solve Get help with specific problems with your technologies, process and projects.

Calling an extended stored procedure in SQL Server 2005

Find out why problems calling an extended stored procedure in SQL Server 2005 can involve security settings.

I'm having a problem calling an extended stored procedure (specifically xp_cmdshell) from java, using the JDBC for SQL Server 2005. By using the JDBC for SQL Server 2000 Service Pack 3, I can call it like a normal stored procedure. With SQL Server 2005, I get the following:

om.microsoft.sqlserver.jdbc.SQLServerException: The request for procedure 'xp_cmdshell' failed because 'xp_cmdshell'...

is a procedure object.

It is a SQL Server 2000 server. I want to use the new 2005 JDBC because it does not have problems with cloned connections in manual transaction mode. I had problems with the selectMethod=cursor property on my webserver, it just didn't seem to take. It worked fine from my local webserver during development, but for some reason doesn't work when running on the live webserver. Is it even possible to call this extended stored procedure?

Yes, by default, it's disabled in 2k5 as it's not considered safe. You can enable it using the Surface Area Configuration Tool if you think it's appropriate.
This was last published in September 2007

Dig Deeper on SQL Server Stored Procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.