Blog Archives

Week 5 – Alternate Solution

Here is how I solved Week 5 of the Database Corruption Challenge. The following steps were tested and confirmed working on SQL Server 2008R2, SQL Server 2012, and SQL Server 2014.   To oversimplify, here are the steps: Restore the

Posted in Uncategorized Tagged with: , , , , , ,

Corruption Challenge Week 4 – The Winning Solution

Congratulations to Randolph West who won the corruption challenge this week with the following solution which restored all of the data. First he restored the database to get started. Note some of his code and comments have been reformatted to

Posted in Corruption Tagged with: , , , , , , ,

Using the TSQL CHOOSE Function

Here is a short video tutorial that shows how to use the CHOOSE function in T-SQL on SQL Server 2012, SQL Server 2014 or Newer. This was originally part of my free SQL query training for the 70-461 certification exam. Here

Posted in 70-461 Training Tagged with: , , , , , , ,

Using the TSQL COALESCE Function

Here is a short video tutorial that shows how to use the COALESCE function in T-SQL on SQL Server. This was originally part of my free SQL query training for the 70-461 certification exam. Here is the first sample code

Posted in 70-461 Training Tagged with: , , , , , ,

T-SQL: A Listing Databases Example Using a Cursor

In SQL Server the cursor is a tool that is used to iterate over a result set, or to loop through each row of a result set one row at a time. It may not be the best way to

Posted in TSQL Tagged with: , , , , , , , ,

SQL Sunday Fun – Word Search with New T-SQL 2012 Functionality

    Click on the grid to enlarge, then print it. Find the following words in the grid up, down, left, right, horizontal, vertical, and diagonal. ROWS  RANGE  PRECEDING  FOLLOWING  UNBOUNDED  IIF  CHOOSE  OFFSET  FETCH  FORMAT  CONCAT  SEQUENCE  PARSE  TRYPARSE 

Posted in SQL Sunday, TSQL Tagged with: , , , , , , ,

CTE Data Paging

Day 14 of Common Table Expression Month (June) at SteveStedman.com, today we will be taking a look at data paging with CTE’s and how it compares to the offset and fetch in T-SQL 2012. These queries will be using that database

Posted in CTE, CTE Book Tagged with: , , , , , , , ,

Multiple CTEs in a Query

Day 10 of Common Table Expression Month (June) at SteveStedman.com, today we will be taking a look at how to use multiple CTEs in a query. These queries will be using that database that was set up in a previous posting

Posted in CTE, CTE Book Tagged with: , , , , , ,

Recursive CTE for Dates In A Year

Day 8 of Common Table Expression Month (June) at SteveStedman.com, today I will be building on the intro to recursive CTEs from yesterday and showing how a recursive CTE can be used to calculate information about dates of the year.

Posted in CTE, CTE Book Tagged with: , , , , , , , ,

Introduction to Recursive CTEs

Day 7 of Common Table Expression Month (June) at SteveStedman.com, today we will be taking a look at the introduction to recursive CTEs. These queries will be using that database that was set up in a previous posting on the CTE_DEMO

Posted in CTE, CTE Book Tagged with: , , , , , , , , , , , ,

Newsletter Signup

Stay informed of Database Corruption Challenge events, and other things happening at SteveStedman.com with my newsletter.
Newsletter signup form.

Stedman Solutions

StedmanSolutionsRemoteSkilledDBA

Common Table Expressions Book

Paperback:

Kindle: