checks pivoted stored procedure