Home Forums SQL Server 2008 T-SQL (SS2K8) select the output of stored procedure with count of returned rows RE: select the output of stored procedure with count of returned rows

  • ok so you are trying to execute stored proc inside join. Also the IF statement should be outside.

    If you can get the date from this stored proc and then count the records.

    I am not sure the data set returned but you can.

    IF @checker is not null

    BEGIN

    INSERT INTO #temp

    (

    column1

    ,column2

    ,....

    exec [dbo].[GetEmployees]

    @parameter1,

    @parameter2

    END

    ELSE

    BEGIN

    INSERT INTO #temp

    (

    column1

    ,column2

    ,....

    exec [dbo].[GetEmployees]

    @parameter3,

    @parameter4

    END