A Simple Introduction to Dynamic SQL
Dynamic SQL is essentially normal SQL written in such a way that you end up with a “customised” SQL script at run-time.
2018-02-12
3,693 reads
Dynamic SQL is essentially normal SQL written in such a way that you end up with a “customised” SQL script at run-time.
2018-02-12
3,693 reads
2017-08-25
967 reads
2016-06-30
1,663 reads
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
This example demonstrates how to perform a pivot using dynamic headers based on the row values of a table. The article also shows how to pass a temp table variable to a Dynamic SQL call.
2017-08-04 (first published: 2015-10-22)
11,921 reads
The script uses dynamic SQL twice
first to get the detail about the database structure and create ddl out of it
second to execute each DDL created
2015-11-03 (first published: 2015-10-07)
947 reads
Based upon todays date as suffix and chosen string as prefix, select data from predefined table into dynamically named new table. Script is properly error handled with most common errors
2016-07-27 (first published: 2015-05-04)
2,316 reads
2015-04-08
2,110 reads
2014-12-09
1,995 reads
Have you ever wanted to run a query across every database on a server with the convenience of a stored procedure? If so, Microsoft provided a stored procedure to do so. It’s unreliable, outdated, and somewhat obfuscated, though. Let’s improve on it!
2016-04-15 (first published: 2014-12-01)
15,443 reads
By Steve Jones
Note: I DO NOT recommend this. Any changes to a pipeline should be in...
By Steve Jones
symptomania – n. the fantasy that there’s some elaborate diagnosis out there that neatly...
I recently received a complaint that Query Store for a particular database was turned...
Comments posted to this topic are about the item 7 sept, scheduled book
Comments posted to this topic are about the item 7 sept, schedlued article
Comments posted to this topic are about the item 6 sept, published book
Azure Data Lake Storage Gen 2 is built on ...?
See possible answers