Dynamic SQL

Execute Dynamic SQL commands in SQL Server

  • Article

In some applications having hard coded SQL statements is not appealing, because of the dynamic nature of the queries being issued against the database server. Because of this sometimes there is a need to dynamically create a SQL statement on the fly and then run that command. This can be done quite simply from the application perspective where the statement is built on the fly whether you are using ASP.NET, ColdFusion or any other programming language. But how do you do this from within a SQL Server stored procedure?

2016-05-03

5,701 reads

Blogs

Power Platform Quick Tips – Episode 03: Documenting Power Automate Flow Logic

By

Welcome back to my series on Power Platform quick tips! In this episode you...

State of Database DevOps Survey

By

Maybe you’re using DevOps within your database development and deployment. Maybe you’re not. Maybe...

HP is the 2019 Laptop Winner

By

This is for me, not necessarily for you, but I decided to go with...

Read the latest Blogs

Forums

Tracking History in Fact Table

By Niggles

Hi, I was hoping somebody would be able to offer advice in relation to...

How to get information about an AG group using powershell

By vsamantha35

Hi Experts, Does anyone has a powershell script which displays below information: for a...

Find out who stopped my SQL Services

By vsamantha35

Hi Experts, Is there a way to find out which windows user has stopped...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers