Michael J. Swart

March 2, 2011

Mandelbrot Revisited.

Filed under: SQLServerPedia Syndication,Technical Articles,Tongue In Cheek — Tags: — Michael J. Swart @ 12:00 pm

So I caught some sort of flu bug recently and that means no new blog post this week. Instead, I’m going to dig through the archives to bring something that you may have missed the first time around.

Today I’m sharing something I first posted two years ago: Something Pretty.

Something Pretty

A T-SQL script I came up with that displays the Mandelbrot set. (Tip: Hit Ctrl-T before executing)

;WITH Numbers ([row]) AS
   FROM sys.columns
SELECT A.row AS x,
   B.row AS y,
   0 AS iter,
   A.row AS iterx,
   B.row AS itery,
   '.' AS symbol
FROM Numbers A, Numbers B
WHERE B.[row] <= 24
-- scale
SET x = x * 3.0 / 100.0 - 2,
   y = y * 2.0 / 24.0 - 1,
   iterx = x * 3.0 / 100.0 - 2,
   itery = y * 2.0 / 24.0 - 1
SET iterx = iterx*iterx - itery*itery + x,
    itery = 2*iterx*itery + y,
    iter = iter+1
WHERE iterx*iterx+itery*itery <= 2*2
GO 257
UPDATE #GRID SET symbol = CHAR(64+(iter%26)) WHERE NOT iter = 257
WITH concatenated (y, c) AS
   SELECT G2.y,
       (SELECT SUBSTRING(G.symbol, 1, 1) AS [data()] FROM #GRID G WHERE G.y = G2.y FOR XML PATH('')) c
SELECT REPLACE(c, ' ', '') FROM concatenated ORDER BY y

You’ll get something like the following:


I’ll be back next week with something new, you have my word.



June 25, 2014

Looking Back at 100 Illustrations

Filed under: Data Cartoons — Michael J. Swart @ 1:05 pm

So I recently took a look at the illustrations I have on this blog and I realize that I’ve got 100 illustrations. I’ve even built a page to show them off. Since 100 is a nice round number, I’m going to take this opportunity to look at some trends. I’ve grouped some of my illustrations into categories:

Movie Franchises

the Princess Bride:

Star Wars:

Star Trek:

Lord of the Rings:


Turns out I’m also a bit of a narcissist:


A little over half of my illustrations are of people, and a smaller fraction are of fictional characters. But only a tiny fraction of those are women. I’m a bit worried about that. Maybe it says something about pop culture. Maybe it says something about me. I’ll have to give that some extra thought.

My Favorites:

This illustration has the right level of snark and it just makes me laugh. In my head I’ve titled this one “Grumpy Ted Codd” and I have this on a mug. It was one of my first illustrations I ever published and I’ve never been able to capture the same feeling of humour and relevance.

I was proud of this one because the likeness turned out. It was one of the first feelings I had that I was getting the hang of this.

Looking back on this now, their heads are too shiny. But this illustration was used with one of my most popular articles and I find myself looking for this article at least once a month. I hit the Browse By Illustration page and start looking for the mythbusters.

I did this one for a guest post on SQL Brit’s site. There were a lot of details in the spaceship and it’s a different kind of drawing than drawing faces. The pun works and I got to reference cheesy 80’s sci-fi… classic.

In General

It’s been a ton of fun. I don’t know what I have in store for the future but I do feel like a change of format is due.

As always, the comment form below is open. I’d like to hear what you think.

April 5, 2010

New Titles

Filed under: SQLServerPedia Syndication — Michael J. Swart @ 10:15 pm

We’re deep in the heart of spring time, a time to celebrate renewal. And if you’re living in Southwestern Ontario, the weather is making it really easy to do. Also coming out in April is a number of new titles (in more than one sense of the word). Here are some that I’d like to share with everyone.

1. The Data Warehouse Toolkit by Richard Kimball

The Data Warehouse ToolkitOkay, so this isn’t a new book, but it’s new to me. What follows here is a review of that book. What I write will seem uncritical, but I’m not going to make up some bad stuff for the sake of balance. It’s that good.

So about a month ago I asked a friend/B.I. Expert Todd McDermid for a good head start on Business Intelligence and he recommended this book.

And after some more digging, I find that he’s not the only B.I. expert to recommend this book. In SQL Server MVP Deep Dives Erin Welker also writes about Business Intelligence:  “From here my best recommendation is to start the way I started, with a book I cannot recommend enough: The Data Warehouse Toolkit by Ralph Kimball”

So the book has been out for a long time and time has shown that the methods established in the book are proven and accepted. I’ve read a number of chapters so far and I’m impressed. I’m averaging a couple AHA moments a chapter. I now have a pretty good idea why the reporting projects I’ve seen in the past have suffered from poor user adoption.

As I’m about to start on some new B.I. project,  I realize that there’s so much I still don’t know. But the book is a good start.

2. Brad Schulz’s New Title, MVP

Last October I had the fortune to be able to interview someone I thought was underexposed, Brad Schulz. His commitment to the SQL Server community was recognized late last week when he was awarded Microsoft’s Most Valuable Professional.

Brad maintains a blog and his latest post was a very gracious thank you. Congratulations Brad! To everyone not Brad, double check that his blog’s feed is in your RSS reader.

3. Brent Ozar’s New Title, MCM

Brent is a prolific blogger and respected DBA. He’s been sharing his experiences with the grueling Microsoft Certified Master training course.

How do I know the course is grueling? Certainly not from personal experience. I just read it on someone’s blog. Now where did I see that… Oh that’s right. Somehow Brent found time to blog about his own MCM training experiences despite the heavy course workload.

And it doesn’t seem to have cramped his writing style either. Whereas I try to generate interest in my blog through drawing cartoons or by generating nifty images (see I’m doing it again), Brent generates interest the old fashioned way. By writing SQL articles which somehow turn into human interest stories. He’s a human being and by design or not, his emotions (and bacon) show in his posts more often than not.

He took the final lab this weekend and describes the experience.  If any exam can be called an experience I understand this one can. Congratulations Brent.

February 6, 2009

Something Pretty

Filed under: Tongue In Cheek — Michael J. Swart @ 7:46 am

A T-SQL script I came up with that displays the Mandelbrot set. (Tip: Hit Ctrl-T before executing)


;WITH Numbers ([row]AS
   FROM sys.columns
SELECT A.row AS x, 
   B.row AS y, 
   AS iter, 
   A.row AS iterx, 
   B.row AS itery, 
   '.' AS symbol
FROM Numbers ANumbers B
WHERE B.[row] <= 24

-- scale
SET 3.0 100.0 2,
   2.0 24.0 1,
   iterx 3.0 100.0 2,
   itery 2.0 24.0 1

SET iterx iterx*iterx itery*itery x,
    itery 2*iterx*itery y,
    iter iter+1
WHERE iterx*iterx+itery*itery <= 2*2
GO 257

UPDATE #GRID SET symbol = CHAR(64+(iter%26)) WHERE NOT iter 257

WITH concatenated (ycAS 
   SELECT G2.y,
       (SELECT SUBSTRING(G.symbol11AS [data()] FROM #GRID WHERE G.y G2.y FOR XML PATH('')) c
SELECT REPLACE(c' '''FROM concatenated ORDER BY y


Wikipedia’s entry on the Mandelbrot set.

January 1, 2009

Browse Articles By Illustration

Filed under: — Michael J. Swart @ 12:00 pm
100 Percent Online Deployments: Keep Changes OLTP-Friendly
Jan 12, 2018
Caption: But if you try sometimes, you might find, you get what you need.
100 Percent Online Deployments: Blue-Green Deployment
Jan 08, 2018
Caption: About to switch blue for green. What could go wrong?
100% Online Deployments
Jan 05, 2018
Caption: Dev Vader Confronts DBA Calrissian
Postponing Our Use of In Memory OLTP
Nov 10, 2017
Caption: In Memory OLTP
Problem With Too Many version_ghost_records
Aug 02, 2017
Caption: I should have called this guy
SQL Server UPSERT Patterns and Antipatterns
Jul 20, 2017
Caption: Trickier than it should be
10 Things I Learned While Working At D2L
Jul 16, 2017
Caption: lego recognition
A Table Of Contents For the Data Industry
May 24, 2017
Caption: Porcellino approves of the O'Reilly cover
Drawing (again) with SQL Server
May 05, 2017
Caption: Spatial results
Find Your Dark Queries
Apr 18, 2017
Caption: If you only knew the performance of the dark side
Case study: Troubleshooting Doomed Transactions
Jan 16, 2017
Caption: We're doomed!
That Time We Fixed Prod Without Admin Credentials
Dec 22, 2016
Caption: The grinch had warded off downtime at least!
I’m Sharing Some Cool Art Prints
Nov 22, 2016
Caption: Her Highnessness
I’m Trying To Kick My “Undo Button” Habit
Nov 08, 2016
Caption: Undo is just step 1 of redo
My 2016
Oct 26, 2016
Caption: Samurai
Build Your Own Tools
Sep 23, 2016
Caption: Service Broker Setup
Simplified Order Of Operations
Jul 20, 2016
Caption: Is it always "or"? Is it never "and"
T-SQL Tuesday #079: It’s 2016!
Jun 06, 2016
Caption: Write about thenew version of SQL Server
You Can’t Force Query Plans If They Use TVPs With PKs
Apr 27, 2016
Caption: On the other hand
Tackle WRITELOG Waits Using the Transaction Log and Extended Events
Apr 11, 2016
Caption: When WRITELOG waits get too big, it needs to be tackled
Microsoft Dropped the Cover Charge on SQL Server
Apr 01, 2016
Caption: Come on in
Look at Blocked Process Reports Collected With Extended Events
Feb 25, 2016
Caption: The Blocked Process Report Viewer now looks at extended events!
Ugly Pragmatism For The Win
Feb 11, 2016
Caption: Just do it! Make your SQL concurrency dreams come true!
You’re Probably Taking Sort Order For Granted Somewhere
Feb 03, 2016
Caption: Reverse your indexes to expose application assumptions about the order of result sets
Sneaky Non-Determinism in Column Defaults
Jan 27, 2016
Caption: Pretty sneaky SQL Server
Cursor Statistics Are Missing in dm_exec_query_stats
Jan 20, 2016
Caption: SQL cursors are so fetch!
My Work Autobiography
Jan 13, 2016
Caption: ... And now 2016! I'm very happy about that
Some Changes for 2016
Jan 06, 2016
Caption: A new blog post every Wednesday!
Troubleshooting Tempdb, a Case Study
Sep 15, 2015
Caption: ... Man, this is going to add like three hours to the movie
Avoid Frequent use of TVPs With Wide Rows
Aug 31, 2015
Caption: ... I left about 50 cause I don't know how much you want to write
What's Going On Inside Tempdb?
Aug 12, 2015
Caption: Gandalf looks through tempdb's transaction log
Types of Performance Metrics
Aug 05, 2015
Caption: Sauron gets an alert about the ring
How to Create Indexed Views Online
Jun 24, 2015
Caption: Some more duct tape should do the trick I guess
It's Hard To Destroy Data
May 20, 2015
Caption: Destroying data can be tricky
Some Tweets I Drew
Apr 01, 2015
Caption: M. C. Escher's woodcuts often feature impossible objects. Linked servers almost qualify.
Some Tweets I Drew
Apr 01, 2015
Caption: A RIGHT JOIN is like going through the McDonald's drive-thru backwards
Some Tweets I Drew
Apr 01, 2015
Caption: Running Enterprise Edition on 8GB of RAM is like the Stig driving Power Wheels
When Parameter Sniffing Caused Deadlocks
Feb 26, 2015
Caption: Parameter sniffing is normally a good thing
Designing Indexed Views for OLTP Workloads
Jan 23, 2015
Caption: Indexed views are like snowflakes, no two are quite the same
Obvious and Not-So-Obvious Writing Tips
Dec 12, 2014
Caption: Ted Codd still hates that thing you just did
Developers, Ready for a New SQL Server Version?
Nov 20, 2014
Caption: Ready? Are you sure?
Watch Out for Misleading Behaviour From SQL Server
Oct 03, 2014
Caption: Not from a jedi.
SQL Server Ignores Trailing Spaces In Identifiers
Sep 18, 2014
Caption: Standards are like a smorgasbord, implement only the ones you feel like
Take Care When Scripting Batches
Sep 09, 2014
Caption: They're very nice, but I asked "Where are your batches?"
Enabling the New Cardinality Estimator in SQL Server 2014
May 22, 2014
Caption: Um, No, I don't want a peanut. But I'll check with the others.
I'm Going To Help You Become A Better Writer
May 08, 2014
Caption: Use the Force, Luke. And maybe the spell checker.
Implementing the Recycle Bin Pattern In SQL
Apr 11, 2014
Caption: A Recycle Bin
I Don't Mind SELECT * Sometimes
Mar 10, 2014
Caption: Support Select *
T-SQL Tuesday #052: Argue Against A Popular Opinion
Mar 03, 2014
Caption: I grow impatient with this rollback. Reboot the server.
Generating Concurrent Activity
Jan 23, 2014
Caption: But many workers don't always work well together
SQL Simplicity Methods
Jan 09, 2014
Caption: Keep it simple SQL Server
“Make Sure That You Really Love Doing It”
Dec 10, 2013
Caption: "Just please make sure that you really love doing it. Because that will get you through the hard times. And the good times."
Hashing for Indexes
Nov 22, 2013
Caption: Who has two thumbs and doesn't worry about hash collisions?
“You’ve got access, but I’m not sure why”
Oct 30, 2013
Caption: It's an older login sir, but it checks out
My Queries For Top 20 Resource Hogs
Sep 19, 2013
Caption: After a while, everything could use a refresh
Three More Tricky Tempdb Lessons
Sep 11, 2013
Caption: Hello Jerry. Hello Tempdb
A Tuning Technique For Parallel Queries
Aug 15, 2013
Caption: ... but it may be tricky to understand exactly how.
Lessons From Sherlock Holmes
Jul 29, 2013
Caption: An outside eye, a second opinion. It's very useful to me. Really!
It Took Me Ages To Figure This One Out: A Puzzle
Jul 03, 2013
Caption: Too easy!
Swart’s Ten Percent Rule
May 28, 2013
Caption: Success: Ninety percent hard work, ten percent coffee
The Sch-M lock is Evil
Apr 17, 2013
Caption: That guy over there won't share the table with anybody...
Altering Text Columns: Only a Metadata Change?
Apr 03, 2013
Caption: I defined a column as CHAR(MAX) and immediately ran out of space everywhere
Splitting Time Between Hobbies
Apr 03, 2013
Checking Out Amazon Redshift
Mar 19, 2013
Caption: Very well Data, open a channel
Follow up on Ad Hoc TVP contention
Feb 28, 2013
Caption: Just one more thing...
Some Failed Blog Topics
Feb 08, 2013
Caption: Take the clustered scan from the query plan and put it in the tan van
PAGELATCH_EX Contention on 2:1:103
Jan 22, 2013
Caption: An important troubleshooting tip:
Joins are Commutative and SQL Server Knows it
Jan 11, 2013
Caption: Quit your fussin
A Grade School Data Project
Dec 18, 2012
Caption: That's my kid!
Triggers On Views? What For?
Oct 31, 2012
Caption: Sad Frankenstein's monster is sad. Patchwork creations deserve love too.
You Can “Do Science” Anywhere
Oct 11, 2012
Caption: Science Rules!
My Short Struggle With SQL Agent
Sep 27, 2012
Caption: Tell me Mr. Anderson, do you want to run as the SQL Agent Service account?
A Quick SQL Challenge
Sep 26, 2012
Caption: A quick puzzle
Some Announcements
Sep 21, 2012
Caption: Hey Michael, What's up?
When I Use Nested Joins
Sep 12, 2012
Caption: "Your country wants YOU to use fewer left joins"
Sharpshooting Query Plans From The Cache
Aug 28, 2012
Caption: "Only Imperial Stormtroopers are so precise."
Avoiding Problems
Aug 10, 2012
Caption: If you come back later, this cow will still be here.
Data Modelling: Composite Relationships
Jul 26, 2012
Caption: I can store your music but I can only guarantee the integrity of the data
T-SQL Tuesday #32 – A Day in the Life
Jul 17, 2012
Caption: My databases ran like clockwork once. There were no pages. Inbox zero. Why couldn't I get that day over and over?
Developing on the Right Side of the Brain
Jul 12, 2012
Caption: I'm sometimes guilty of using ten percent of my brain
I’m Sharing My Story at SQL Brit’s Site
Jun 13, 2012
Caption: The Last Starfighter: An accidental DBA (Death Blossom Administrator)
Visualizing Transaction Isolations For SQL Server
Jun 13, 2012
Caption: Locks taken by SQL Server for the standard isolation levels
MERGE Statement Generator
May 30, 2012
Caption: Merge quickly!
The View of Foreign Keys That I Wanted
May 23, 2012
Caption: A nice view of Key Largo
Lessons From Geordi La Forge
May 14, 2012
Caption: WWGLFD?
Modifying Tables Online – Part 5: Just One More Thing
Apr 27, 2012
Caption: Just one more thing ...
Modifying Tables Online – Part 1: Migration Strategy
Apr 16, 2012
Caption: This is how I feel when I'm running the sp_rename step
Sending Query Results to Others
Mar 28, 2012
Caption: Show me the data!
SQL Server 2012 Launches Today
Mar 07, 2012
Caption: Ceci n'est pas un lancement.
I Was Kidding Myself
Feb 27, 2012
Caption: Vizzini: War Starter, Shorty/Meanie, Dizzying Intellect, Not Immune To Iocane Powder
Careful Hashing
Feb 15, 2012
Caption: Careful when converting strings
Microsoft Model Databases: Some Unconventional Alternatives?
Feb 09, 2012
Caption: Putting your best foot forward
Removing Duplicate Dimension Rows in SSIS
Feb 02, 2012
Caption: Filter Everything But The First Row
Rebuild Your Indexes Online (When You Can)
Jan 25, 2012
Caption: We can rebuild it online... We have the technology.
My favourite search terms
Jan 18, 2012
Caption: Oh! You've come to the right place my boy!
Then, Now and Later
Jan 04, 2012
Caption: Marty McFly ... also looking forward to the future
Write Better
Dec 20, 2011
Caption: I hope to one day write a hundredth as well as Mark Twain.
CXPACKET? What's That? And What's Next?
Dec 08, 2011
Caption: "Many hands make light work?" or "Too many cooks spoil the brothe?"
SQL Fingertips
Nov 29, 2011
Caption: My favourite fingertip.
Be Quick About Reading The Data You Asked For
Nov 16, 2011
Caption: These two don't yield; They're on a mission.
Insights into "Timeout Expired"
Nov 06, 2011
Caption: A timeout always represents server unresponsiveness from the client's point of view
Where Are Your Popular Joins?
Oct 26, 2011
Caption: "Join me ..."
Secret Santa as a Puzzle
Oct 19, 2011
Caption: Fun tip: The MVP Deep Dives (Vol 2.) is under the spending limit!
Power View Demo Good, Not Great
Oct 13, 2011
Caption: "No data was harmed in the preparation of this demo" ~Amir Netz
Missing the PASS Summit
Oct 11, 2011
Caption: You shall not go to PASS!!!
A Program to Find INSERT Statements That Don't Specify Columns
Sep 21, 2011
Caption: Name those columns!
Artificial Intelligence versus SQL Server Help
Sep 21, 2011
Caption: "I am putting myself to the fullest possible use, ..."
Mythbusting: Concurrent Update/Insert Solutions
Sep 08, 2011
Caption: Don't try this at home! We're what you call experts!
ACID Properties By Example (And Counterexample) Part Four: Durable
Aug 23, 2011
Caption: Recently, I learned that Richard Harris sang 'MacArthur Park'...
ACID Properties By Example (And Counterexample) Part Three: Consistent
Aug 10, 2011
Caption: Never show them your work in progress
ACID Properties By Example (And Counterexample) Part Two: Consistent
Aug 03, 2011
Caption: "'C' is for cookie. That's good enough for me." ~Cookie Monster
ACID Properties By Example (And Counterexample) Part One: Atomic
Jul 27, 2011
Caption: It's interesting: For most people, the word atomic only refers to a process where atoms are split.
ACID Properties By Example (And Counterexample) Part Zero
Jul 20, 2011
Caption: It's interesting: Some ACID properties are basic!
Make Your Life Easier With Fun Denali Tricks
Jul 06, 2011
Caption: Easy as pie!
Poking Around Inside Management Studio
Jun 29, 2011
Caption: Paying attention to the man behind the curtain!
Midyear Resolutions
Jun 22, 2011
Caption: s/hobbit/ewok
Enforcing Business Rules Vs. Avoiding Triggers: Which Is Better?
Jun 15, 2011
Caption: Ladies! Please! One at a time!
Forget About PIVOT, You Don’t Need It
Jun 08, 2011
Caption: Be Honest, you can't remember the syntax either!
A Round-up of Round-ups and other Meta Things
Jun 01, 2011
Caption: Metadata!
Another Advantage of Consultants
May 25, 2011
Caption: When we built Jurassic Park we spared no expense!
Okay, You’ve Found Blocking, Now What?
May 18, 2011
Caption: Aaaawww yeaaah! Michael's BPR Viewer is the only way I find lead blockers!
When To Use Blocked Processes Reports
May 04, 2011
Caption: When am I supposed to use the Blocked Process Report Viewer?!
Woo Hoo... Microsoft Certification Exam 70-451
Apr 27, 2011
Caption: I have my moments... I recognize them when I can
A New Way to Examine Blocked Process Reports
Apr 20, 2011
Caption: There's a new way to look at blocked processes!
Whew… Microsoft Certification Exam 70-433
Apr 13, 2011
Caption: There's good odds that this guy does better than me on section 5!
Data Modelling: My Favourite Example
Apr 06, 2011
Caption: New sport! Synchronized bulk loading
Something Light-hearted.
Mar 30, 2011
Caption: I get that a lot, I'm not the Resource Governor, I'm a Colonel, I don't throttle run-away queries... just chickens
Something Light-hearted.
Mar 30, 2011
Caption: PASS has lined up a new performer for the 2011 summit.
Something Light-hearted.
Mar 30, 2011
Caption: That day she was amazed to discover that when he was saying "It depends" what he meant was "I love you"
Last Word On Scans
Mar 23, 2011
Caption: Sorting out execution plan scans, seeks and lookups
What Does Microsoft Mean By Scans?
Mar 16, 2011
Caption: You keep using that word
The Aggregate Function PRODUCT()
Mar 07, 2011
Caption: Get excited about T-SQL's new PRODUCT!
Mandelbrot Revisited.
Mar 02, 2011
Caption: I know, I know, I don't like re-runs either.
How Full is Fill Factor 100?
Feb 23, 2011
Caption: I did save room for dessert! Thanks for asking!
Searching Inside Strings: CPU is Eight Times Worse For Unicode Strings
Feb 16, 2011
Caption: One more trick for my mental utility belt!
Pinal Dave: Blogger, MVP and now Interviewee
Feb 09, 2011
Caption: "These blog entries are truly my journey ... This journey is truly remarkable, that's why I continue to walk on it ~Pinal Dave
Ridiculously Unnormalized Database Schemas – Part Three
Feb 02, 2011
Caption: This is the cow ... that jack built
Ridiculously Unnormalized Database Schemas – Part Two
Jan 26, 2011
Caption: Get rid of redundant Data!
Ridiculously Unnormalized Database Schemas – Part One
Jan 19, 2011
Caption: Ted Codd hates that thing you just did!
Ridiculously Unnormalized Database Schemas – Part Zero
Jan 12, 2011
Caption: The brain: Full of information, but normal ones are extremely rare!
My 2011 Resolution
Jan 11, 2011
Caption: Michael J. Swart resolves to be less introspective.
Why Michael J Swart won’t be at the PASS Summit this year.
Nov 07, 2010
Caption: Huh! I expected more people here.
DBA humour
Oct 05, 2010
Caption: Data (Bass)

Powered by WordPress