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

Beginning T-SQL and Career Roadmap for Women (and Men)! #SQLSatBR

By

Download session materials and watch the recordings of my excellent sessions on Transact-SQL and...

Actual Kubernetes

By

This post continues looking at my process of learning more about Kubernetes. I’ve been...

New product: Azure Data Share

By

A brand new product by Microsoft called Azure Data Share was recently announced. It...

Read the latest Blogs

Forums

How to make in memory SQL transformations within a data flow task

By svenflock

Hi all, first of all, I am new to Integration Services. I googled everything...

CAST FOR XML - Illegal Name Character

By jamie_collins

I am trying to write a query that generates an html report to be...

Get the inactive records in sqlserver

By kbhanu15

HI Team, please help to get the expected data. my Data like below: create...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers