Can anyone please help with the following case concerning T-SQL:
If you have one stored procedure called SP_A which calls inside it's stored procedure called SP_B and you have the following instruction as the first line in SP_A: SET NOCOUNT ON
. I know the NOCOUNT variable has a batch scope so it's worth to mention that there are no GO
commands anywhere in the body of either stored procedures.
Will the NOCOUNT have effect in the child stored procedure (SP_B)?
Example SP_A code:
CREATE PROCEDURE dbo.SP_A
AS
BEGIN
SET NOCOUNT ON
EXEC dbo.SP_B
END
Example SP_B code:
CREATE PROCEDURE dbo.SP_B
AS
BEGIN
SELECT * FROM dbo.SOME_TABLE
END
Will the select from the SP_B procedure print number of affected rows?