sp_executesql is a system stored procedure in Microsoft's SQL Server product range (2005 onwards) for running dynamic SQL.
sp_executesql
is a system stored procedure in Microsoft's SQL Server product range (2005 onwards).
It is used for running dynamic T-SQL Statements or batches, including support for embedded parameters.
It is also what the .NET framework uses for ad-hoc queries when parameters are added to a SqlCommand
.