Thursday, August 28, 2014

[Event Notifications] saves the day again...

Got the morning ERRORLOG email courtesy of EN.  And I got several hundred messages from ERRORLOG.  During a patch, the Agent XPs were disabled but not reenabled.  So the Agent service was up, but didn't do anything.

Ironically enough, it wasn't just the ERRORLOGs that saved me - it was SQL Sentry, which hit (and failed) the XPs once a minute.  Which, yay, caused an ERRORLOG message, but didn't actually TELL me it wasn't working.  (I've submitted a bug fix for that).

Just another of those "my god, how do I live without this" posts.

ALL my EN code is in this share:

Additionally, my Gists (source code of the code I use in production) are at:

Wednesday, August 27, 2014

[SQLSaturday] Thanks for coming to see me at Oklahoma City!

Thanks again for all the generous hospitality, and the 28(!) people who came to my session.  It seemed like everybody enjoyed it!  I got a bunch of good reviews, and a couple suggestions I'll implement for SQL Saturday 300 (This. Is. Kansas City!) but feel free to let me know what I could have done to improve things - I know the room was warm and I saw people flagging near the end.

Matt Brimer did an amazing job, and I will definitely return.  Great venue, most of the speakers were good, food was awesome.  All around, a fantastic SQLSat.

Slides and everything are available off the SQL Saturday Web site, at:

Note that that's not only all my slides, but the scripts as well.  I have a newer, complete version of the Repository - I'll have that put up on here in the next day or so (updated: , see "EN Full Repository Setup").  That should be everything required to run the code on your servers.  Installers, new databases, everything.


Tuesday, August 19, 2014

[Interesting] Linked Server is cached for a session

Since I spent 20 minutes trying to diagnose it this morning...

Say you have a session open.  That session invokes a query that hits a linked server.

Now change the linked server.  Drop and recreate, point it at a different server.

New sessions get the new definition, but existing sessions use the old definition.

Monday, August 18, 2014

[Presenting] Last minute - SQLWatchdog at the Fort Worth SQL Server User Group, Wednesday, August 20th

Just had a last-minute invite, and it seemed an awesome opportunity to present & hone it one more time before my forthcoming SQL Saturday presentations (OKC this weekend, KC next month) for more details.  It'll be Wednesday, August 20th, 2014, at 7pm.

Yes, this is the presentation I did there almost 2 years ago, expanded, fleshed out, and with Cat Pics. Because if there's one thing a presentation needs, it's Cat Pics.

See you there!

Monday, July 21, 2014

[Presenting] Double your TheBakingDBA exposure! Come to the Kansas City SQL Saturday!

Just got the email - I'm presenting at SQL Saturday 300, Kansas City!

Despite the name, this is the same presentation I've been giving (aka SQL Watchdog) - I submitted this before changing my title.  We'll be adding a few other features as well, based on past suggestions from both audiences as well as my own internal folks.

It sounds like it'll be awesome - Bob Ward is speaking, they're going to have a BBQ Crawl on Friday, sounds like there's an event at the ballpark, there's a group going to a local theme park to ride the coasters...

Man.  Cannot wait.

Sep 13 2014 
Cerner Corporation's Riverport Campus
6711 NE Birmingham Rd, Kansas City, MO 64117

Tuesday, July 8, 2014

[Presenting] Woot! I'm presenting at SQL Saturday 309, Oklahoma City!

Pleased and proud to have been selected to present at #SQLSatOKC, aka SQL Saturday 309, aka SQL Sat Oklahoma City.  Doing my presentation (continually updated) on Event Notifications, and capturing DDL changes (along with other fun stuff like Deadlocks and Errorlogs) in real time, and what you can do with that.

As always, I'm trying to figure out how to include all the details necessary to do it, not TOO many details, and add some fun stories on "heh, look how I saved the day". 

While actually remembering to breathe - a lot of details, and honestly, I get excited about presenting it.  The goal is to make the passion shine through, without seeming like a Spaz or newbie speaker. 

SQL Saturday Oklahoma City:
Aug 23 2014 at 13301 South Pennsylvania Avenue, OKC, OK 73170.

Monday, June 30, 2014

[Presenting] PASS Summit 2014 - Bummed and Congrats!

Got back from vacation on Tuesday.  Check twitter sometime that morning - and lo and behold, the PASS Summit 2014 sessions are picked!  Check email - nothing.  Check the schedule - well, I guess "not picked"  doesn't deserve an email.  Thanks.  Check on twitter (because honestly, a "why" would be nice) - no, I should have gotten something.  Long story short - 4 hours later, I get the email.  I already knew from looking at the schedule that I wasn't picked - which was a kick in the pants, having presented it 5 times at this point.

However, a silver lining - it appears I was rejected because someone else was presenting on something similar.  Indeed!  So a hearty congrats to Colleen Morrow!  While I personally think EN curb-stomps SQL Audit, I'm glad to see the subject of checking for code changes in the environment will be presented at PASS.  Colleen's already shown (via her chapter in Tribal SQL) that she knows quite a bit about all the options, and writes passionately on the subject, so I have no doubt it'll be a great session.  Wish I could see it.  : )

Friday, May 30, 2014

[WAT] more screwy date conversion

So, let's convert some dates

DECLARE @my_month DATETIME = '20140530'
SELECT SUBSTRING(CAST(@my_month AS VARCHAR(8)), 5, 2) + '/01/' + SUBSTRING(CAST(@my_month AS VARCHAR(8)), 1, 4)


But what if we set that date to an Int?
DECLARE @my_month int = '20140530'
SELECT SUBSTRING(CAST(@my_month AS VARCHAR(8)), 5, 2) + '/01/' + SUBSTRING(CAST(@my_month AS VARCHAR(8)), 1, 4)


Monday, May 12, 2014

SQL Saturday 308 - SQL Watchdog - scripts and slide deck

Someone mentioned a problem with the scripts being corrupt on the SQL Saturday website.  Here's a copy of my most recent presentation.  All the scripts, including the repository creation scripts (zip-within-the-zip). 

Holler if you have any questions, thanks again to Nancy and Allen for allowing me to present and treating us like rockstars, and thanks to everyone who attended SQL Saturday Houston!


and the whole folder of goodies (old versions, warts and all) is available at:

Saturday, May 10, 2014

[Event Notifications] Hekaton prevents EN?!


Memory-optimized tables and natively compiled stored procedures cannot be created or dropped if there is a server or database event notification for that DDL operation. Remove the server and database event notifications on CREATE TABLE or DROP TABLE and CREATE PROCEDURE or DROP PROCEDURE.

What happens if you attempt to do it?

 Msg 10794, Level 16, State 124, Line 1
The feature 'EVENT NOTIFICATION' is not supported with memory optimized tables.

Why is this a big deal?  Because, honestly, I'm scared that if they're not supporting things like this, that EN is on its way out.  I use it extensively (see my presentations on it, coming soon to a SQL Saturday near you), and it's IMHO a must-have feature.  It also means that whenever we want to do something with Hekaton, we have to drop the EN, do the Hekaton-based changes, then we're less likely to use Hekaton or EN.  

Please vote on my Connect item: