Here are three ways by which dynamic SQL can be executed- 1-Writing a query with parameters 2-Using EXEC 3-Using sp_executesql
• Writing a query with parameters. • Using EXEC. • Using sp_executesql.