Sunday, April 3, 2016

Dynamic SQL

Dynamic SQL




Example from AdventureWorks:
http://www.sqlusa.com/bestpractices/dynamicsql/
http://sqlusa.com/bestpractices/training/scripts/dynamicsql/
https://www.mssqltips.com/sqlservertip/1160/execute-dynamic-sql-commands-in-sql-server/
http://stackoverflow.com/questions/2588013/dynamic-sql-to-query-an-adventureworks-table
http://www.sqlteam.com/article/using-dynamic-sql-in-stored-procedures
http://oakdome.com/programming/SQL_DynamicSQL_sp_executesql.php
http://www.kodyaz.com/articles/t-sql-pivot-tables-in-sql-server-tutorial-with-examples.aspx
https://www.brentozar.com/archive/2013/11/filtered-indexes-and-dynamic-sql/

Dynamic SQL and Procedures:
https://www.youtube.com/watch?v=MiAwOoelu9k

SQl Server Dynamic SQL:
https://www.youtube.com/watch?v=jS3kpNavKM8

Dynamic SQL / Adhoc SQL (6 min short video):
https://www.youtube.com/watch?v=aRr6q4V0sXY

Table names would vary at run time and schema would vary at runtime:
https://www.youtube.com/watch?v=n3odG4bl4LE

2 comments:

  1. Nice post...I look forward to reading more, and getting a more active part in the talks here, whilst picking up some knowledge as well..

    Pass Box manufacturers

    ReplyDelete