Dynamic SQL

External Article

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

Getting SQL Server 2025 RTM Running in Containers on macOS

By

SQL Server 2025 RTM is here, and if you’re running Docker on macOS, you...

The PASS Data Community Summit 2025 Recap

By

It’s Monday. I’ve been home since Fri night, but with a busy weekend, I’m...

Microsoft Post-Quantum Crypto APIs Are Now Generally Available

By

I mentioned this in my talk on Quantum Computing at the PASS Data Community...

Read the latest Blogs

Forums

The Ending Substring

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Ending Substring

Done is Better than Good

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Done is Better than Good,...

Configuring the On-Premises Data Gateway: The Fabric Modern Data Platform

By John Miner

Comments posted to this topic are about the item Configuring the On-Premises Data Gateway:...

Visit the forum

Question of the Day

The Ending Substring

In Azure SQL Database and SQL Server 2025, if I run this, what is returned?

SELECT '[' + SUBSTRING('Steve Jones', 7) + ']'

See possible answers