We have a stored procedure that is supposed to run other stored procedures based on a parameter that gets set by the first stored procedure. However, while everything works fine in the Microsoft SQL Server Management Studio, when the stored procedure is run through the report, the very first if statement is run instead of the correct if statement.