For example, when we want to determine the displayed columns in our reports, this procedure might be a solution … Executing the dynamically constructed SQL batches is a technique used to overcome different issues in SQL programming sometimes. EXECUTE (Transact-SQL) 08/07/2017; 28 minutes to read +6; In this article. The sp_executesql is a built-in stored procedure in SQL Server that enables to execute of the dynamically constructed SQL statements or batches. APPLIES TO: SQL Server Azure SQL Database Azure Synapse Analytics (SQL DW) Parallel Data Warehouse Executes a command string or character string within a Transact-SQL batch, or one of the following modules: system stored procedure, user-defined stored procedure, CLR stored procedure, scalar-valued user-defined …