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

Using Git Prune–#SQLNewBlogger

By

As I’ve been working with SQL Saturday and managing changes to events, I’ve accumulated...

Microsoft Purview new data governance features

By

Starting last week is a rollout of the public preview of a new and...

SQL Database Administration: Not For Everyone (But Maybe It’s for You)

By

Let's get one thing straight: database administration isn't the most glamorous tech job out...

Read the latest Blogs

Forums

Create Copy of DB in same server.

By terry999

Hi I want to create a copy of a DB on the same server....

SSRS Expression IIF Zero then ... Got #Error

By danyeungw

Hello, Need some help for SSRS. The column % expression is =iif(sum(Fields!ColumnA.Value) = 0...

Insert using table unput

By Bruin

I have a table that I need to run off a different server\db and...

Visit the forum

Question of the Day

Restoring the Resource Database

How can I restore a version of the Resource Database in SQL Server 2022?

See possible answers