Blog Archives

Database Corruption Challenge Week 7 – Alternate Solution

The alternate solution to the Database Corruption Challenge this week was created by Patrick Flynn. This solution is the only solution to successfully recover all the data without using any of the backups. If the challenge had been structured differently

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

How Do You Check if a Database Exists…

How do you check if a database exists, drop it and recreate it for testing purposes? After running the Database Corruption Challenge for several weeks now, I have seen many scripts to drop and recreate a database. This makes it

Posted in Corruption Tagged with: , ,

Database Corruption Challenge Week 4 Results

It is my pleasure to announce the winners in the Week 4 Database Corruption Challenge. But first how about a rundown of challenge. In order to make up for the difficult time that Challenge #3 was issued, Challenge #4 was

Posted in Corruption Tagged with: , , , , ,

Week 4 – Building the Corrupt Database

The following are the steps that I went through to create a more difficult Database Corruption Challenge for Week 4. Here is how I built the database, nothing fancy, however I did add an extra FILEGROUP called [UserObjects]. Notice, that

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

Using the TSQL IIF Function

Here is a quick video tutorial on how to use the IIF function on SQL Server 2012, SQL Server 2014 0r newer. This was originally part of my free SQL query training for the 70-461 certification exam. Here is the sample

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

CTE Data Paging in a Procedure

Day 15 of Common Table Expression Month (June) at, today we will be taking a look at data paging with CTE’s in a function. Yesterday we took a look at CTEs for Data Paging, today we will build on what

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

Introduction to Recursive CTEs

Day 7 of Common Table Expression Month (June) at, 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: , , , , , , , , , , , ,

T-SQL: A Simple Example Using a Cursor

For more information on cursors, also take a look at the free SQL query training provided by Steve Stedman. In SQL Server the cursor is a tool that is used to iterate over a result set, or to loop through each

Posted in SQL 2008, SQL 2012, TSQL Tagged with: , , , , , , ,

Recursive Scalar Function in T-SQL

In my Common Table Expressions presentation the topic of recursion often comes up, but for scalar functions in T-SQL, it might not be as common. This article has been written to show how a scalar function in SQL Server can

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

SQL Server 2012 IIF Statement

SQL Server 2012 introduces the IIF statement. It is very similar to the IIF statement in MS Access. I have extracted the IIF part of my presentation on Whats new in SQL Server 2012, and turned it into a video

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

SQL Server Performance Tuning

Need help with SQL Server Performance Tuning, contact Steve at Stedman Solutions, LLC for help, or take a look at the performance tuning page at the blog. We can help with tuning a single query or with figuring out why your SQL Server is running slow. Free 30 minute consultation.

Newsletter Signup

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

Stedman Solutions