T-SQL Tuesday 114 – Puzzle Party

Words: 1,858

Time to read: ~ 5 minutes

It’s T-SQL Tuesday time and this time we have Matthew McGiffen ( blog | twitter ) who is asking us about a Puzzle Party!

Let’s see what exactly he is asking us though.

• Present a puzzle to be solved in SQL and challenge your readers to solve it.

• Or give us a puzzle or quiz about SQL or databases.

• Show the SQL solution to a classic puzzle or game.

• Provide a method for solving a classic sort of querying puzzle people face.

• Show how newer features in SQL can be used to solve old puzzles in new ways.

• Tell us about a time you solved a problem or overcame a technical challenge that was a real puzzle.

• Or just make your own interpretation of “puzzle” and go for it!

Matthew McGiffen

I didn’t have much in the idea department for most of them so I’m thankful that Matthew left us with the last own interpretation option. So here is my attempt at a puzzle.

Invoke-LollerCoaster!

Should I Cheat?

It’s a slightly strange story but I had already done a slight “puzzle” or “trick” in PowerShell where I created a Loller Coaster Don’t ask me why, blame Andy Mallon ( blog | twitter ).

Now, that implementation used PowerShell but I thought to myself…

You know what…it uses System.Data.DataTable…that’s nearly the same thing as querying from a database. Could I get away with posting that?

Me

In the end, I decided against using the PowerShell version and said is there anyway that I could port it over to SQL Server?

PowerShell

First, you can find the PowerShell version of this in my Github account here:
https://github.com/shaneis/RandomScripts/blob/master/Invoke-Lollercoaster.ps1

I’m more proud of that than this attempt…

Look at it go!!!

SQL Server

Now for the SQL Server version.

Let’s create our table in tempdb and populate it. Could this have been made more compact? Perhaps with some fancy string manipulation and some such?

Oh yeah! But this was a quick job done during my lunch break and I wanted it done more than I wanted it perfect.

Plus, if you don’t like the below, you’re really not going to like what I use in the actual script…


USE tempdb;
GO
IF OBJECT_ID(N'dbo.LollerCoaster', N'U') IS NOT NULL BEGIN
	DROP TABLE dbo.LollerCoaster;
END;
GO
CREATE TABLE dbo.LollerCoaster (
	loller_coaster_id tinyint IDENTITY(1, 1) NOT NULL,
	loller_coaster_stage varchar(4000) NOT NULL
);
GO
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
        __)
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
         __)
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          __)
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL\
           O\)
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O\
            L\)      LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L\        LOL   LOL
             O\)    O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O\      O   O O   O
              L\)   L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L\    L     L     L
               O\) O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O\_)O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O__)O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O       O   O O   O
              L    )L     L     L
               O _/O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L         LOL   LOL
             O      )O   O O   O
              L    /L     L     L
               O  /O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O
            L        )LOL   LOL
             O      /O   O O   O
              L    /L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O          ) 
            L        /LOL   LOL
             O      /O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL            )
           O          / 
            L        /LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O          __)
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O           __)
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O            __)
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O          
            L         LOL\  LOL
             O       O   O\)   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O          
            L         LOL   LOL
             O       O   O\O   O
              L     L     L\)   L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L\    L
               O   O       O\) O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O__)O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L    )L
               O   O       O _/O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O  \O
              L     L     L    )L
               O   O       O  /O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O  \O
              L     L     L    )L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O( \O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O/  O
              L     L     L()   L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L(    L
               O   O       O\) O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O__)O
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O __)
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O  __)
                LOL         LOL
                               O
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL\
                               O\)
                                L     LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O\
                                L\)   LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L\    LOL
                                 O\) O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O\_)O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L     LOL
                                 O__)O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O
                                L    )LOL
                                 O _/O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL        )
                               O      /
                                L    /LOL
                                 O   O
                                  LOL')
INSERT INTO dbo.LollerCoaster (loller_coaster_stage) VALUES ('
          
        LOL
           O         
            L         LOL   LOL
             O       O   O O   O
              L     L     L     L
               O   O       O   O
                LOL         LOL
                               O      __)
                                L     LOL
                                 O   O
                                  LOL')
GO

Next we’ll need to set up some things and create a few variables

SET NOCOUNT ON;
-- Set Ctrl + T to send results to text!

DECLARE @Counter tinyint;
DECLARE @End tinyint;
DECLARE @Stage varchar(4000); -- Horribly oversized, I know and apologise.
DECLARE @Pause varchar(12);
DECLARE @Clear varchar(4000); -- again, apologies...

Then we can set the variables that we have

SET @Counter = 1;
-- I could move this after the insert and use @@ROWCOUNT
-- but I created/inserted into the table in a different session.
SET @End = (SELECT COUNT(*) FROM dbo.LollerCoaster);
-- Just 15 line feeds
SET @Clear = REPLICATE(CHAR(13), 15);

Then… the rest is a WHILE loop. 😦

RAISERROR(@Clear, 0, 1) WITH NOWAIT;

WHILE @Counter <= @End BEGIN

	SET @Stage = (SELECT loller_coaster_stage FROM dbo.LollerCoaster WHERE loller_coaster_id = @Counter);
	
	RAISERROR(@Stage, 0, 1) WITH NOWAIT;

	IF @Counter &gt;= 21 AND @Counter <= 29 BEGIN
	    SET @Pause = '00:00:00.100';
	END; ELSE BEGIN
		SET @Pause = '00:00:00.200';
	END;

	WAITFOR DELAY @Pause;
	RAISERROR(@Clear, 0, 1) WITH NOWAIT;
	SET @Counter += 1;
END;

There’s only a few things to mention here.

  • I’m clearing the screen at the start just for cleanliness.
  • There’s a tight loop between counters 21 and 29 where we want to simulate it speeding up.
  • We’re setting a pause between each one since we want the users to actually see the differences.
  • It can be improved so much!
USE [tempdb];
GO
SET NOCOUNT ON;


DECLARE @Counter tinyint;
DECLARE @End tinyint;
DECLARE @Stage varchar(4000);
DECLARE @Pause varchar(12);
DECLARE @Clear varchar(4000);

SET @Counter = 1;
SET @End = (SELECT COUNT(*) FROM dbo.LollerCoaster);
SET @Clear = REPLICATE(CHAR(10), 15);

RAISERROR(@Clear, 0, 1) WITH NOWAIT;

WHILE @Counter <= @End BEGIN

	SET @Stage = (SELECT loller_coaster_stage FROM dbo.LollerCoaster WHERE loller_coaster_id = @Counter);
	
	RAISERROR(@Stage, 0, 1) WITH NOWAIT;

	IF @Counter &gt;= 21 AND @Counter <= 29 BEGIN
	    SET @Pause = '00:00:00.100';
	END; ELSE BEGIN
		SET @Pause = '00:00:00.200';
	END;

	WAITFOR DELAY @Pause;
	RAISERROR(@Clear, 0, 1) WITH NOWAIT;
	SET @Counter += 1;
END;
It's a sled riding down a rollercoaster made of the word LOL repeating.
No, I don’t know why the sizes change half-way through.

T-SQL Tuesday #112 – Roundup

Words: 2850

Time to read: ~ 15 minutes

Cookies

I’m going to keep this intro short and sweet. I’d like to say it’s because I know these roundups are for acknowledging and thanking the people who have contributed, and this is the case! Mainly though it’s because I wrote this bit last and I’ve already written… checks … 2,795 words!

So thank you one and all for participating. I’ve never thought the posts would raise feelings of happiness, sadness, thoughtfulness, and appreciative-ness that this one has.

I encourage anyone and everyone to get in touch with Steve and host a T-SQL Tuesday. It is well worth it, amount of typing necessary included.

Andy Leonard ( Blog | Twitter )

https://andyleonard.blog/2019/03/t-sql-tuesday-112-the-cookie-jar

Coincidence, Andy was listening to the same audio book as I was 😁

It’s a heavy list reading what Andy has gone through and, while he says himself that he is not sharing everything, what he does list proves the mental mettle that he has.

Although, I much prefer his phrase of “weaponised ADHD” to “mental mettle”.

What are his cookies? His children and wife (cute x2), friends, accomplishments, and military service but his main one is his faith. His faith itself and his faith that nothing has been sent his way that he cannot bear.

Andy Levy ( Blog | Twitter )

https://flxsql.com/t-sql-tuesday-112-the-cookie-jar/

I feel like Andy appreciates cookies.

In fact he dedicates the first portion of his post saying that you should be creating and putting yourself into situations where you need to rely on these cookies. If not, are you even living and learning?

His cookies are being able to look back on the fact that, when things seemed too daunting, he could look back and realise that he had done these steps before.

Handy when you have to migrate 8,000 databases.

Arun Sirpal ( Blog | Twitter )

https://blobeater.blog/2019/03/12/t-sql-tuesday-sharing-cookies/

Trial by fire. Thrown in the deep end. Learn by doing.

However you want to call it, it is what Arun had to deal with after a few weeks as a “Junior level / entry level DBA”.

Tier 1 customers, multiple node clusters, performance tuning, dealing with stakeholders and developers, and all after a couple of weeks.

Arun’s cookies are knowing that if things are getting tough, he’s already gone through these dark times and can rely on past experiences.

Going by what I know of Arun now, the fire has tempered him well.

Bert Wagner ( Blog | Twitter )

https://bertwagner.com/2019/03/12/dipping-into-the-cookie-jar/

For a man who’s presentations and videos are known and appreciated by so many it may surprise you to know that Bert, before each presentation, is a nervous wreck!

Like I’ve heard affects most people, this dread seems to come from an inner voice. A voice whispering in his ear;

“Speaking is scary.”

“This is a big audience.”

“This joke will bomb.”

His cookies, which I like to think he shoves into that inner voice’s mouth to shut it up, is to calmly rationalise it away with this past experience.

“Speaking is …. ooff” – You’ve done it before, you can do it again.
“This is a big audien… ah stop!” – Your online audiences have definitely been bigger.
“This joke will bomb…. no, I don’t even like raisin cookies!” – You won’t know until you try. And your past session reviews indicate that people think you are funny.

Serves that voice right if you ask me…

Cathrine Wilhelmsen ( Blog | Twitter )

https://www.cathrinewilhelmsen.net/2019/03/12/technical-accomplishments-happy-memories/

First of all I have to apologies to Cathrine for spelling her name with an unwarranted “e” between the “h” and the “r”. I’m sorry that it took this long for me to realise.

I will admit that the Law of Jante, while fascinating, should not curtail you talking about the accomplishments you have achieved when you have put the work in.

Cathrine’s cookies are technical and non-technical in nature. BIML, MVP (1 of 2 female MVPs in Norway), author, and co-author. Her technical achievements are inspiring but it’s her non-technical achievements that bring joy.

As Cathrine says “pictures speak louder than words” so do what I did; scroll through the pictures and let the SQL Family feelings bring a smile to your face.

David Alcock ( Blog | Twitter )

http://sqlclarity.blogspot.com/2019/03/dipping-into-cookie-jar.html

Unfortunately, like Andy Leonard, David recently lost his father and I want to extend my condolences to both of them.

If there is one thing I can say about David’s post, it would be that I completely agree with his statement “I always say to people not to trivialise the challenges they’re going through; whether its seemingly big or seemingly small a challenge is exactly that, a challenge.”

An anxiety attack is nothing to scoff at and, from reading his description, it’s not something that I would wish on anyone.

David’s cookies came from fighting this anxiety day by day, minute by minute, and heartbeat by heartbeat and realising in fighting it, that there is a well of inner strength available to him.

As he put it…

A big part of that process was drawing upon that strength to have the courage to speak to others, those close to me. To use the cookie jar analogy; I needed help to open it, perhaps I needed to have the top loosened for me, and I certainly needed help to reach those cookies that were at the very bottom of the jar

Doug Purnell ( Blog | Twitter )

https://sqlnikon.com/2019/03/12/t-sql-tuesday-112-cookie-monster/

“Internal mojo”? I can dig it!

Doug talks about having to migrate off of SQL Server 2008 instances since THEY ARE LOSING EXTENDED SUPPORT PEOPLE!

Doug’s cookie is a process, a maxim really.


“What’s the ONE Thing you can do such that by doing it everything else will be easier or unnecessary?”

I’ve heard about this a few times and it’s something that I have to put into practice. Sometimes the thought of something is more intimidating that actually doing it. Procrastination is an eventually killer, when it gets around to it…later.

Taking that one step, that one move, that one action can snowball into a massive effect. After all…


A journey of a thousand miles begins with a single step

You just have to take it.

Glenda Gable ( Blog | Twitter )

http://sql313.com/index.php/44-main-blogs/maincat-dba/cat-career/96-t-sql-tuesday-112

Shameless plug #2 – check out dbafuntube.org for videos of the past presentations as well!

Reading Glenda’s post is like seeing a slideshow of accomplishments, each one leading on to bigger and better things harder obstacles.

Her cookies are these accomplishments, from writing an ETL process before she knew it was a thing, to working with Microsoft on her TB in size database.

As Glenda says in her post I work with Glenda and a few others in helping to organise the DBA Fundamentals Virtual Chapter and she tends to shy away from pointing out her accomplishments. So allow me to say this for her.

If the work that Glenda produces for the Virtual Chapter is anything to go by, she is being modest in her achievements here and we truly love what she does and look forward to the next challenge she demolishes!

Jan Mulkens ( Blog | Twitter )

https://blog.janmulkens.be/t-sql-tuesday-112-dipping-into-your-cookie-jar/

I count myself lucky to have the chance to talk to Jan at SQLBits this year.

I can fully attest that he does practice what he preaches of

– Don’t yearn for anything, it will only bring you sadness.
– Be positive as hate and negativity in general will only erode yourself.
– Whatever you do, act out of kindness towards others and help them first.
– Always tell the truth


Even if the truth leads you down some weird speculative reasoning which you wish you could forget 😐

Jan’s cookie is interesting in that he counts the times where others have seen the extraordinary potential that he has and nurtured it.

Catching a few of Jan’s sessions over the past year or so I can say that this nurturing of his potential has not been wasted.

Jeff Mlakar ( Blog | Twitter )

https://www.mlakartechtalk.com/t-sql-tuesday-112-facing-unknown-with-confidence/

“Facing the Unknown with Confidence” could have the subtitle “Building upon Success”.


Start with what you know. Then work to what you don’t know (learning)

Jeff Mlakar

I like Jeff’s style. It instills a sense of practicality and purpose.

A case of “I will deal with what I know, learn what I don’t, and continue the fight another day”.

Jess Pomfret ( Blog | Twitter )

https://jesspomfret.com/t-sql-tuesday-112/

I should not be surprised that a cookie that Jess states, since she’s into PowerShell, DSC, and automation, is to automate herself out of boring process that made her a bottleneck.

Her second one is presenting and the confidence that comes from practice and repetition.

I’m looking forward to seeing her presentations in conferences like DataGrillen, especially if her posts on the topics are anything to go by.

Plus, if these cookies aren’t enough, she is also kicking ass in CrossFit I’m lead to believe.

Jon Shaulis ( Blog | Twitter )

https://jonshaulis.com/index.php/2019/03/12/t-sql-tuesday-112-dipping-into-my-cookie-jar/

Jon and Arun sense a common ancestory in their blog post. They have both had a trial by fire, even “singed” by it as he says.

Honestly some of the shifts that he has pulled are scary….18 hour and 36 hour shifts are not what I would like.

They are necessary sometimes, if not to quench the fires, then to at least quell them.

Another cookie, that he very graciously is willing to share, is his scripts.

I’ve always said the 2nd best cookie is the one that is unexpectedly given freely to you.

Thank you Jon!

Kenneth Fisher ( Blog | Twitter )

https://sqlstudies.com/2019/03/12/dipping-into-the-cookie-jar-t-sql-tuesday-112/

I’m going to start this one off by saying I don’t know what Double Stuff Oreos or Thin Mints are?

Kenneth brings a lot of cookies to the table; his wife, his kids, his scripts (Thank you Kenneth), his blog, his wife, his work, and passed SQL Family members.

Kenneth’s post has the ability to merge the bittersweet with the comedic with a link to his favourite post and a link to a tweet where I praise/blame him and Andy Mallon ( Blog | Twitter ) for introducing me to twitter. That makes me want to laugh and cry!

Kevin Chant ( Blog | Twitter )

https://www.kevinrchant.com/2019/03/12/t-sql-tuesday-passing-mcsd-azure-architect-exams/

If there is anything that is going to motivate you, it’s a deadline. There is even a law about it!

I would like to think that was the reasoning going through his head when he decided to take a shot at this certification. I’ve talked about reading the David Goggins book when I wrote the invitation.

Kevin taking this challenge, spending nearly every second of the day studying, and passing the final exam with 2 days to go is extremely Goggins-esque.

The cookie that this brings, the knowledge of what you can do when you put your mind to it, must be one of the most satisfying that I can think of.

Kevin Hill ( Blog | Twitter )

https://dallasdbas.com/t-sql-tuesday-cookies-we-love-cookies/

I’ve never had a nickname conferred on me by a blog before. I’m quite happy with “The Shane” as long as it’s meant in a good and not a bad way…

Kevin says that he has…ahem…a richness in years in which to gather a store of cookies.

One thing that Kevin doesn’t mention is his blog posts with the Junior DBA and his subsequent training and hiring of his very own Junior DBA. Coupled with his new Pluralsight course shows that Kevin has no intention to stop baking cookies.

Also, he has an amazing ability to ruin my coffee 😂

Lisa Bohm ( Blog | Twitter )

http://lisagb.info/archives/54

Grandma’s Chocolate Chip Cookies. 🤤

Her cookies? Turning DBAs from people who always said no and were avoided to being part of each of the scrum teams, developing both the front end and a back end that lasted 16 years, and spending 12 years earning the trust and love of a shot horse.

I find it amusing that Lisa mentions Kevin Hill (above) and myself in her post. Mainly because her post is all about helping others, and I’m still convinced that she was playing a pool shark that night!

Nate Johnson ( Blog | Twitter )

https://natethedba.wordpress.com/2019/03/12/t-sql-tuesday-112-cookies/

I’m thankful that Nate managed to get a T-SQL Tuesday post in on schedule this time! 😊

Some cookies are bittersweet. I’m sure that Nate has had to dig deep a few times in the past few months so I’m slightly touched that one of his cookies is looking back on the memories of his wife and on how right she has been, nearly all the time.

Another cookie he has is that, even if a project is not wildly successful, it counts as a success if lessons are learned and the problems can be reasonably addressed.

Raul Gonzalez ( Blog | Twitter )

http://www.sqldoubleg.com/2019/03/12/t-sql-tuesday-112-dipping-into-your-cookie-jar/

Double G’s jar of cookies is a jar of scripts (the analogy may not work but the scripts certainly though!).

If I had written a T-SQL Tuesday post, I would have to include Raul in it for taking me under his wing as a Junior DBA. So thank you Raul, both for the scripts and for the mentoring!

Having used and installed some of the scripts in my current role, I’m thankful for Raul in sharing these scripts.

And also for making them available on Github for other people to pull and modify them.

P.S. Raul’s wife makes probably the best tiramisu I’ve ever tasted.

Reitse Eskens ( Blog | Twitter )

https://sqlreitse.home.blog/2019/03/12/t-sql-tuesday-112-dipping-into-your-cookie-jar/

I like to keep my hand in the dbatools and dbachecks modules. I’ve been lucky enough to add to them and I’ve been seeing Reitse selflessly involved more and more in them.

One of his cookie is the reaction of others. Working on training, every road block or white, blank page is countered with seeing the delighted reaction of people when they “get it”.

His cookie is actually giving a cookie back. Thanking each and every person who

write a blog, work on a site, publish vlogs or anything, chances are i’ve seen and/or read it. Thank you for your time!

Rob Farley ( Blog | Twitter )

http://blogs.lobsterpot.com.au/2019/03/13/t-sql-tuesday-the-confidence-cookie-jar/

There is a saying that I was told growing up that went “yesterday’s goals don’t win today’s matches” and that is what I’m hearing from Rob’s post. That past successes do not mean things are going to be okay going forward.

So while Rob says that he doesn’t have a cookie to look back on, if I could be so cheeky to say that I see hidden ones in his post, then please indulge me.

Rob stamps his personality on the post so there is no need for me to try and interpret it. Read the post and take his words, filled with conviction, in for yourself.

I stand on who I am, on who God says I am, and figure that I can get through somehow. Not because I have done in the past, but because I will in the future.

Rob Sewell ( Blog | Twitter )

https://sqldbawithabeard.com/2019/03/12/tsql2sday-nomnomnomnomnom/

Rob starts his post out with saying that his cookies are people. By seeing the accomplishments of others, where he has played a small part.

Thinking about the amount of people that Rob has helped and played a part of over time, I’m glad to know the amount of cookies that Rob has access to is not insignificant.

It’s his second cookie, his cake, that really resonates though. Rather than spoil it for you here, please read it and let me know if it’s not something that you would like to be able to do yourself.

Rudy Rodarte ( Blog | Twitter )

https://www.rodolforodarte.com/2019/03/t-sql-tuesday-march-2019-dipping-into-the-cookie-jar/

It’s not every day that you read a post where the cookie was a bored and angry toddler!

Rudy has encountered one of the same cookies I have had, helping another person with their CTE.

From speaking, coding, and improving it’s clear that Rudy has used his cookies to help cultivate a cool under pressure composure.

Steve Jones ( Blog | Twitter )

https://voiceofthedba.com/2019/03/12/the-t-sql-tuesday-112-cookie/

I’m not going to lie, it was only the last day that I saw that Steve had done a post so I didn’t give it as much time as the others. Apologies Steve

Steve’s cookie is, when things get difficult, he thinks back on how he used a new technology to accomplish a needed task. And if any of you have seens Steve’s post on SQL, PowerShell, Python, R, etc., etc. you know that he has past experience with new technologies.

If “past experience with new” makes sense…

SQL Undercover ( Blog | Twitter )

https://sqlundercover.com/2019/03/12/tsql-tuesday-112-dipping-into-the-cookie-jar/

https://sqlundercover.com/2019/03/12/tsql2sday-112-mini-cookies/

Not sure if it counts when a single site submits two posts but seeing as I can’t figure out whether the posts were written by 2 different people or the same person… who am I to stop ’em?

The posts seems to have 2 different main values as their cookies. Growth and Anticipation.

Read them both, trace the growth and learning of one post, and the anticipation of the “carrot” cookie on the other.

See if you can figure out who wrote which post. I can’t, when they say undercover I guess they mean it!

Todd Kleinhans ( Blog | Twitter )

https://toddkleinhans.wordpress.com/2019/03/12/t-sql-tuesday-112-a-new-cookie-jar/

I knew Todd liked the idea of VR! Damn, that’s a lot of links.

From motivational links, mental visualisation, to future projections, Todd takes us on a exciting, if dizzying, experience on his cookies.

I have heard of hyperphantasia before but with the thought that VR could help enable this for anyone is a cool concept.

I may have watched the Rocky movies again after reading this post…

T-SQL Tuesday #112 – Dipping into your Cookie Jar.

Words: 559
Time to read: ~ 3 minutes

Dipping into the Cookie Jar

I’ve been listening to audio-books on the way into work, and the current one struck a chord with me.

It’s “Can’t Hurt Me” by David Goggins and it is about his story from a rough upbringing “into a US Armed Forces icon and one of the world’s top endurance athletes“.

One part of the story that has stuck in my mind is where he talks about “dipping into the cookie jar“. It’s an analogy that is easy to follow when you understand it.

Dipping into the Cookie Jar is about when the going gets tough and you don’t think you can handle anymore, then you think back about your accomplishments and take some sustenance from them. You dip back into that cookie jar and use whatever energy that provides to keep going.

Things are going to be tough for everyone at some stage or another. There are going to be low points spread out among the highs. While I know that reaching out to the SQL Family is an amazing external resource to help lift the members up, I think it’s also important for people to remember those accomplishments and realise that they have an internal resource as well.

That is what I want from the contributors of this T-SQL Tuesday, those memories that they can think back on for sustenance. Like the humble cookie, I want a humble brag.

Share some cookies

This month’s T-SQL Tuesday is about finding those cookies and sharing them.

These cookies do not have to be massive. Like the various cookies out there, they can be big or small – or even technical.

So tell me about a time when you had an accomplishment that can keep you going.

  • About the time you made your first server specification for a new SQL Server instance.
  • About the first time you wrote out the syntax for a Recursive CTE by memory.
  • About the time you knew the answer to a technology question from someone else.
  • About after all the study you passed the certificate you were after.
  • About the time you created a PowerShell script, or a Python script, etc. and it worked.
  • About the time you created a PowerShell script, or a Python script, etc. and it didn’t work but you were able to fix it.
  • About how you inherited an unorganised instance and made improvements to it.
  • About how you stood, trembling and scared for your first presentation, but you did it in the end.

The above “cookies” are all technical but your ones don’t have to be. Whatever your favourite cookie is, let me know.

Let’s get to the rules.

Not made to be Broken

T-SQL Tuesday has the following rules:

  1. Publish your contribution on Tuesday, 12 Mar 2019 between 00:00 UTC to 23:59 UTC.
  2. Include the T-SQL Tuesday Logo and have it link to this post.
  3. If your post doesn’t link back, please comment below with a link to your post.
  4. Tweet about your post using the #tsql2sday hashtag.
  5. I highly encourage you all to host as well, get in contact with Steve Jones ( blog | twitter ) to get your name on the list!

That’s it!

There is your challenge; realise that you have a cookie jar, realise that it is filled, and share a cookie with us.

Enjoy!

P.S. No coconut cookies please, never like ’em. 😦

T-SQL Tuesday #111 – What is Your Why?

Words: 752

Time to read: ~ 4 minutes

T-SQL Tuesday this month is hosted by Andy Leonard ( blog | twitter ) and he asks what is your why. What it is that makes you do what you do.

I’ve spent the best part of the day with this question rattling around in the back of my mind which is not helpful when you’re trying to troubleshoot problems with the left over cranial resources.

Now that I have a chance to sit down at my desk, crack open the laptop, and put methaphorical ink to paper I believe that I have some sort of an answer.

I don’t know.

There is something very appealing about being asked a question and being able to say a definitive answer to it. Yet none of the questions that I asked myself had definitive answers.

Q: Is it the joy of learning?

A: Sure. I like learning.

But there is embarassment in not knowing and a sense of dismay in realising you’ll never learn enough or know everything that you need to know.

Q: Well, is it because you find meaning in spreading information and teaching others.

A: Sure. I like teaching.

But it’s not mainly meaning that I get out of it, to be perfectly honest, a lot of the time it’s solace. There are sour, low points that everyone goes through that makes the high points in life all the sweeter. That doesn’t make the low points any less daunting. Spreading information, teaching others, and helping out are some of the most effective ways I’ve found to counteract these dull and grey valleys.

Q: Is your why databases? You love everything about them.

A: Sure. Databases are my first real IT infatuation

But I’m infatuated with a lot of different IT aspects. Any chance I get, you’ll find me discussing PowerShell with others, I’m trying to learn Python on the side, I’m an AWS user at work, a closet Azure user at home, and have a dream about bursting Azure out for work.

And yet…

Reading back on the above paragraphs I’ll admit that it comes across as slightly “doom and gloom”.

Yet I don’t want that to be the message here. I’m okay with not “finding myself” when I became a DBA and that being my reason why, mainly because I’m more a believer in “making yourself” than “finding yourself”.

Those points above that I mentioned are not my final say on the subjects.

I know that there is never an end goal with knowledge and learning. That doesn’t mean that there is no point in trying. It’s in striving and fighting for that impossible, never-ending goal that we become better out of it.

Even though meaning isn’t what I attain from spreading information and teaching, that doesn’t mean that the work does not have meaning. There are people I’ve interacted with and met who’s work deserves to be shared. People who have gotten relief from a seemingly unfixable problem or just a nudge in the right direction when they are fumbling for an answer in the dark. Just because I’m also helped in helping does not devalue any of its worth.

And as for being infatuated with other technologies, let me point out something real quick. The SQL Server community is very quickly becoming the Data community; DATA:Scotland, Data Grillen, etc. etc. The days of SQL Server as a data store only is, if not already gone, very soon finished. These other infatuations can be molded and melded together to reach a total greater than their original parts.

Case in point from the last conference I attended:

While this post doesn’t rain down fire and fury about the passion of my why, please don’t take from it that I am not passionate. If my why is not a wildfire, I consider it more as a molten magma. Slightly unknown but vast and inexorable.

And if words are not enough then actions may show differently.
It’s around 40 days into the New Year and I’ve already given my first presentation, booked 3 conferences, volunteered at another, come back from a SQL Saturday on the other side of Europe, and when I get a chance to finally sit down at the end of the day, I write out a blog post to join the rest of the SQL community bloggers.

I’m looking forward to reading theirs and how they can help put a sense of shape to mine.

So what is my Why?

I don’t know but I’m okay with that.