Let’s say I want to run a stored procedure in an isql session and then send the result set via mail:
isql -S-U -P 1> set nocount on 2> exec PSTEST 'F', 7 3> go x y - ----------- A 1 F 7 Z 9 (return status = 0)
but then you get this “(return status = 0) which is not that nice. So for some time I’ve been using grep -v “return status” or sed on the result file to remove the unwanted line until I’ve found out that you can actually disable printing of the return status with a nice command:
set proc_return_status off
Here’s the result set with this parameter turned off:
isql -S-U -P 1> set nocount on 2> set proc_return_status off 3> go 1> exec PSTEST 'F', 7 2> go x y - ----------- A 1 F 7 Z 9
Quoting the documentation:
proc_return_status
controls sending of a return status TDS token back to the client. set proc_return_status off suppresses sending the return status token to the client, and isql client does not display the (return status = 0) message. The default for this parameter is on.