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

Daily Coping 17 Sep 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Ethics in Modern Data at Music City Tech 2021

By

  On Sept 16, Christine and I presented our joint presentation on Ethics in Modern Data at...

Slides and Video from Building a Regret-free Foundation for your Data Factory Now Available

By

Last week, Kerry and I delivered a webinar with tips on how to set...

Read the latest Blogs

Forums

SQL 2016 SP3 CHECKDB WITH EXTENDED_LOGICAL_CHECKS problem.

By Ken McKelvey

This seems to be the same problem which occurred with SQL2017 CU21 and is...

Find all SPs, FNs, and VWs where particular string occurs

By Vladimir Isaev

I have this task to find all SPs, FNs, and VWs where particular string...

Excel privary levels

By V

There are three Excel privacy levels: Private, Organizational, Public. When Excel's privacy level is...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers