I have a JAVA developer asking me this question. I am not sure how to answer him. I am not sure I understand his question. He is using JAVA to call my procedure. "Is there some conclusive signal returned by the the SP result that would letus know whether it succeeded or failed? I'm currently looking for the word "exception" in the error message, but that hardly seems conclusive to me."
Check: http://www.sommarskog.se/error-handling-II.html http://www.sqlteam.com/article/handling-errors-in-stored-procedures HTH
I have my code coded as "EXEC master.dbo.xp_cmdshell @cmdline". If I had it coded as "EXEC @returncode = master.dbo.xp_cmdshell @cmdline, NO_OUTPUT", would that help him?
How that SP is called at the Application? I believe using the common calls procedures you can use OUTPUT from SP too.
This web site helped: http://social.msdn.microsoft.com/Forums/en/transactsql/thread/08f65989-fb96-4c0c-9ed9-d7d6329c10d6 Here is an example of what I was trying to do: DECLARE @cmdline VARCHAR(1000) DECLARE @RC INT DECLARE @EM VARCHAR(8000) DECLARE @temp TABLE (RM VARCHAR(500)); SELECT @cmdline = 'dir f:' INSERT @temp EXEC @RC = master.dbo.xp_cmdshell @cmdline SELECT @EM = RM FROM @temp WHERE RM IS NOT NULL PRINT @RC PRINT @EM