An ounce of design is worth a pound of rework...
Home     Design Book     DMV Book     Links     Non Database Stuff     Contact me     About     Presentations     Calendar of Events     Downloads     Code Snippets     SQL Articles/Blogs      

 Document Title

Description 

 

 

 Useful queries

 

 Finding tables with no primary or alternate keys

Useful for valdating your database. All tables should have a pkey, and in most cases, when using surrogate keys, an alternate key as well. 

 

 

 General SQL Tips

 

 Local Variable Tables and Transactions

Shows that the data inserted into a local variable table is not lost even if the transaction it is created in is rolled back

 

 

  SQL Fun

 

 A Thousand Monkeys

Fun query that tries to demonstrate how terribly unlikely the thousand monkeys with a thousand typewriters myth truly is 

 

 

 SQL Version Enhancements

 

                             2005

 

DDL triggers

DDL Triggers are cool and let you monitor what kinds of changes have been made to your system. 

SNAPSHOT ISOLATION LEVEL

Isolation level that lets you have consistent results across queries by giving you a version of the data that is consistent as of when your transaction started.

READ_COMMITTED_SNAPSHOT

Works like SNAPSHOT ISOLATION LEVEL, but works at a statement level rather than a transaction level. 

INTERSECT and EXCEPT   

New query operators that compliment UNION 

 Ranking - ROWNUMBER().htm

Extremely cool feature that lets you add a unique number to every row of your output, and even based on order/grouping criteria 

Ranking - RANK(), DENSE_RANK() and NTILE().htm

Ranking/Windowing Functions that let you add positional information to the output of your queries

               

 

Add your content here