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

Updated Pluralsight Course – Kubernetes Installation and Configuration Fundamentals

By

My updated course “Kubernetes Installation and Configuration Fundamentals” in now available on Pluralsight here! If you want...

Power BI and a Star Schema

By

I sometimes get asked from customers if they should use a star schema or...

A New Git Default Branch

By

I learned a new trick from Andrew Pruski. In a blog on avoiding PowerPoint,...

Read the latest Blogs

Forums

How to write update query to check exist column by value 1 where it exist on tab

By ahmed_elbarbary.2010

How to update check exist column by value 1 where partid exist on table...

User unable to see Logins after recreation of permissions in new instance

By johnylemony

Hello All I was tasked with setting up a new instance on the same...

Monitor SQL Server Error Logs with PowerShell

By WillemG

Comments posted to this topic are about the item Monitor SQL Server Error Logs...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Adding N/A

See possible answers