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 is the sample code that goes along with the CHOOSE function training. This sample code has been tested and confirmed …

Using the TSQL CHOOSE Function Read more »

Using the GO commend in TSQL to run a batch of code multiple times is something that I commonly do in demo’s and training’s.  What amazes me is how many people after the training will tell me that they didn’t know about using the GO command to run a statement multiple times. Here’s how it works. First lets create a table, …

Executing a TSQL batch multiple times using GO Read more »

Friday I had a great day at Redgate’s SQL In The City presentation by Steve Jones (@way0utwest). There were three sessions presented which are summarized below. Session 1 – Team-based Database Development with Version Control I thought that this session was going to mostly review for me since I am already familiar with the Redgate SQL Source control product, and use …

A great day at SQL In The City by Redgate Read more »

At the end of my SQL Saturday presentation today on Advanced Common Table Expressions, which is about the 12th time I have presented on CTEs, I was asked a question that I have been asked many times after I present.  I am blogging about this because I have been asked about it so many times. This one one of those …

SSMS Results In A Separate Tab Read more »

Day 4 of Common Table Expression Month (June) at SteveStedman.com, today I will cover the topic of terminating the previous T-SQL statement. These queries will be using that database that was set up in a previous posting on the CTE_DEMO Sample Database, if you haven’t set up the sample database, download it and set it up now. To start with having …

Common Table Expressions – Terminating the Previous Statement Read more »

As I have presented my Common Table Expressions presentation many times, and as part of writing the Common Table Expressions Book I have created some sample database scripts to use. Once you load up the script into SSMS and refresh the databases tree item, you will see a new database called cte_demo that includes 2 tables. dbo.Departments The first table is called …

Sample Database for Common Table Expressions Read more »

Being day 12 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREEPROCCACHE. Description: DBCC FREEPROCCACHE is used for purge all of the parsed query plans out of memory. This is commonly used in development environments, but not as common in a production environment. Use in a development environment is common, for instance when you are …

DBCC FreeProcCache Read more »

As I work on testing the Database Health Reports project, I have configured several test servers running as virtual machines using Hyper-V. Part of setting these up for testing, I usually end up installing the sample databases for SQL Server. The sample databases give me something to test against, and what usually ends up happening is I end up polluting …

Installing Sample Databases for SQL Server 2008R2 Read more »

The following articles are a collection of my favorite SQL Server related posts over the last 6 months. 3 Steps to Work More Efficiently in SSMS. Posted 2/17/2013 Recently the 3 Steps to Work More Efficiently in SSMS article was one of my favorites. The three steps were: Display results in a separate tab. Hotkey for SELECT TOP 100 * FROM … …

Select Favorite SQL Server 2012 Articles Read more »

# The key to twitter is to follow the right hash tags.  What hash tags do you follow related to Microsoft SQL Server? Here are a few of the twitter hash tags that I follow: #SQLServer The generic SQL Server hash tag. Most anything goes on this hash tag. #SQLHelp The #SQLHelp hash tag is great when you need to …

What twitter hash tags do you follow for SQL Server? Read more »