SQL Server Procedure has already been executed error


We are just converting our application from Oracle to SQL Server.

When running stored procedures, sometimes running them twice in a row generates the "Procedure has already been executed" error and sometimes in doesn't.

We are not closing the procedure in any scripts, just declare and execute, and same as we do for Oracle.


declare cca_variance_report_sql procedure for ddf_cca_variance_report @as_curr_invoice = :is_invoice_no, @as_prev_invoice = :is_prev_invoice_no;
execute cca_variance_report_sql;

This testing is SQL Server 2014 with a PB 11.5 app currently.

Appreciate your thoughts.


Question Tags: