Question: what is the difference between stored procedure and dynamic sql?
Answer: Stored procedures beat dynamic SQL in terms of performance. A stored procedure is cached in the server memory and its execution is much faster than dynamic SQL. If all the remaining variables are kept constant, stored procedure outperforms dynamic SQL.