-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Bert Wagner

Bert Wagner is a Business Intelligence Developer at Progressive Insurance. He enjoys solving challenging data transformations with T-SQL and optimizing for query performance. In addition to BI development, Bert loves building ASP.NET MVC web apps and building Internet of Things projects.

COUNT, DISTINCT, and NULLs

Watch this week’s episode on YouTube.

One thing I see fairly often (and am occasionally guilty of myself) is using COUNT(DISTINCT) and DISTINCT interchangeably to get an idea of the number of unique values in a column.

While they will sometimes give you the same results, depending on the data… Read more

4 comments, 100 reads

Posted in Bert Wagner on 19 February 2019

Parsing HTML in SQL Server

Recently I was asked how to parse text out of an HTML fragment stored in SQL Server.

Over the next few seconds my brain processed the following ideas:

  • SQL Server is not meant for parsing HTML. Parse the data with something else.
  • T-SQL does have functions like REPLACE, CHARINDEX, and…

Read more

0 comments, 939 reads

Posted in Bert Wagner on 12 February 2019

Why make?

This post is a response to this month’s T-SQL Tuesday #111 prompt by Andy Leonard.  T-SQL Tuesday is a way for the SQL Server community to share ideas about different database and professional topics every month.

In this month’s topic Andy asks why do we do what we do? Read more

1 comments, 82 reads

Posted in Bert Wagner on 12 February 2019

Automating Database Maintenance with Jess Pomfret and dbatools

dbatools is one of the coolest community projects I’ve seen – it is amazing how many commands are available to help make managing your SQL Server instances a breeze.

This week I had the opportunity to learn how to use dbatools to automate backups, change recovery models, and discover additional… Read more

2 comments, 112 reads

Posted in Bert Wagner on 5 February 2019

Cardinality: Not Just For The Birds

Watch this week’s episode on YouTube.

When building indexes for your queries, the order of your index key columns matters.  SQL Server can make the most effective use of an index if the data in that index is stored in the same order as what your query requires for… Read more

1 comments, 774 reads

Posted in Bert Wagner on 29 January 2019

Optimizing for Ad Hoc Workloads

Watch this week’s episode on YouTube.

The execution plan cache is a great feature: after SQL Server goes through the effort of generating a query plan, SQL Servers saves that plan in the plan cache to be reused again at a later date.

One downside to SQL Server caching almost… Read more

3 comments, 1,969 reads

Posted in Bert Wagner on 22 January 2019

SQL FAILS with Andy Mallon, Erin Stellato, and Mr. Anonymous!

Watch this week’s video on YouTube.

While most of us strive to make as few mistakes as possible when it comes to our servers and data, accidents do occasionally happen.

Sometimes those accidents are easily fixed while other times the solutions require herculean efforts (usually accompanied by lots of caffeine… Read more

0 comments, 2,133 reads

Posted in Bert Wagner on 15 January 2019

T-SQL Documentation Generator

This post is a response to this month’s T-SQL Tuesday #110 prompt by Garry Bargsley.  T-SQL Tuesday is a way for the SQL Server community to share ideas about different database and professional topics every month.

This month’s topic asks to share how we automate certain processes.


I’m a… Read more

3 comments, 183 reads

Posted in Bert Wagner on 8 January 2019

Visualizing Hash Match Join Internals And Understanding Their Implications

This post is part 3 in a series about physical join operators (be sure to check out part 1 – nested loops joins, and part 2 – merge joins). 

Watch this week’s episode on YouTube.

Hash Match joins are the dependable workhorses of physical join operators.

While… Read more

6 comments, 2,272 reads

Posted in Bert Wagner on 2 January 2019

2018 Community Influencer of the Year

A few days ago I was surprised to learn from Aaron Bertrand of SentryOne that he was selecting me as Community Influencer of the Year for 2018.

Aaron states that the Community Influencer of the Year award goes to, “someone who has made a dramatic impact on the SQL… Read more

0 comments, 928 reads

Posted in Bert Wagner on 1 January 2019

Visualizing Merge Join Internals And Understanding Their Implications

This post is part 2 in a series about physical join operators (be sure to check out part 1 – nested loops joins, and part 3 – hash match joins). 

Merge joins are theoretically the fastest* physical join operators available, however they require that data from both… Read more

5 comments, 2,575 reads

Posted in Bert Wagner on 18 December 2018

Visualizing Nested Loops Joins And Understanding Their Implications

This post is the first in a series about physical join operators (be sure to check out part 2 – merge joins, and part 3 – hash match joins). 

What Physical Join Operators Tell Us

Everyone has their own method of reading an execution plan when performance tuning… Read more

3 comments, 171 reads

Posted in Bert Wagner on 11 December 2018

Two Words For Faster Scalar Functions

Watch this week’s episode on YouTube.

WITH SCHEMABINDING optimizations were added all the way back in SQL Server 2005.  So why bother talking about them in 2018?

Because no one is taking advantage of them!

Ok, maybe that’s a little unfair.  I’m sure some people advantage of the optimizations,… Read more

23 comments, 185 reads

Posted in Bert Wagner on 4 December 2018

Brute Forcing SQL Logins and Passwords

Watch this week’s episode on YouTube.

Following up on last week’s post about the different types of SQL injection, this week I want to show how injection can be used to obtain a SQL login and its password.

My goal with today’s post is to show how easy… Read more

0 comments, 309 reads

Posted in Bert Wagner on 27 November 2018

4 SQL Injection Techniques For Stealing Data

Watch this week’s episode on YouTube

I’m not advocating that you start using SQL injection to start stealing other people’s data.

However, I do think that you should familiarize yourself with the various SQL injection techniques so that you will be better prepared to prevent them from happening in your… Read more

4 comments, 3,152 reads

Posted in Bert Wagner on 20 November 2018

Bert & Pinal Troubleshoot a Slow Performing SQL Server

What happens when you run into performance tuning expert Pinal Dave?  Talk about how to troubleshoot a slow performing SQL Server of course!

This week is all about the video, so if you can’t view it above, head on over to my YouTube channel to watch it there. Read more

3 comments, 258 reads

Posted in Bert Wagner on 13 November 2018

Learning New Skills

This post is a response to this month’s T-SQL Tuesday #108 prompt by Malathi Mahadevan.  T-SQL Tuesday is a way for the SQL Server community to share ideas about different database and professional topics every month.

This month’s topic asks to share how we learn skills other than SQL… Read more

0 comments, 2,555 reads

Posted in Bert Wagner on 6 November 2018

The 5 Scariest Moments for a SQL Server Developer

While families and friends are scaring each other this Halloween week with stories of ghosts and ghouls, I thought it’d be way scarier to talk about truncate tables and source control.

Accidental Data Deletion

You’ve spent all morning loading millions of records into your tables.  Some of that data was… Read more

4 comments, 4,863 reads

Posted in Bert Wagner on 30 October 2018

Unexpected Shorthand Date Implicit Conversions

I do my best work in the mornings.  Evenings are pretty good too once I get a second wind.

Late afternoon are my nemesis for getting any serious technical or creative work done.  Usually I reserve that time for responding to emails, writing documentation, and brewing coffee.

Some afternoons I… Read more

4 comments, 2,755 reads

Posted in Bert Wagner on 23 October 2018

Conditionally Returning Rows Based On Query Results

While I normally prefer formatting my query results in a downstream app/reporting layer, sometimes I can’t get around adding some business formatting logic to my SQL queries.

Today I want to show you four different ways to conditionally output rows of data based on a SQL query.

Setting Up The…

Read more

0 comments, 2,471 reads

Posted in Bert Wagner on 16 October 2018

Older posts