Search Results for: extended event

Query To Retrieve Statistics Data: dm_db_stats_histogram

Starting with SQL Server 2016 Sp1 CU2, a new way of directly querying statistics, specifically the histogram, has been introduced: dm_db_stats_histogram. We've always been able to query the statistics using DBCC SHOW_STATISTICS. However, the output, three different result sets with three different structures, made automating access to statistics information a pain. Now, we have more capability through dm_db_stats_histogram. dm_db_stats_histogram To access the information in dm_db_stats_histogram, you just have to pass in the object_id and the statistics_id values for the statistics you're interested in like this: SELECT * FROM sys.dm_db_stats_histogram(OBJECT_ID('HumanResources.Employee'), 1) AS ddsh; It's very straight forward to use. The results look like this: Handy right? Now you can query the histogram directly. Yeah, I hear a few of you saying... and this helps me... how? Here's an example. This query…
Read More

Execution Plans, Performance Tuning and Rum

[caption id="attachment_2827" align="alignleft" width="150"] This is me on the last cruise[/caption] In just a few more weeks I'll be setting sail on the first of two SQL Cruise events this year. I'm honored beyond my ability to appropriately express it to be included as one of the Technical Leads for both the cruise in February (7-14, 2015, I think there's a seat or two left) to the Caribbean and the one in June (14-21, 2015, definitely a couple of seats left) to the Mediterranean. Lest you think that this is just an excuse to hang out and drink, you ought to know a little about how sessions are presented on the cruise and the sessions I'm presenting. Don't mistake sessions on the boat for your typical one hour session at…
Read More

Database in Source Control

Many years ago, I was working with a great DBA. Seriously, a very smart and capable guy. He told me, "We need to put the database into source control, just like app code." And I just laughed. Not because I disagreed with him. I knew he was right, but I had tried, several times, to do just that. See, I'm not really a DBA. I'm a developer. I knew that code (and all the T-SQL that describes databases is code) needed to be versioned, sourced, tracked and audited. But great googly moogly, it was not an easy thing to do. I first tried just exporting the entire database into a script and then occasionally checking that script into source control. Yay! Mission Accomplished... Well, I had a database in source…
Read More

SQL in the City, US Tour 2013, Recap

Red Gate visited three cities this year with our SQL in the City event; Pasadena, Atlanta and Charlotte. I just wanted to give you a quick assessment of how the events went from my point of view. Overall, each and every one of these events was awesome. I can safely say that because each and every one of these events provided something special, the opportunity to network with our peers and with the developers and project managers at Red Gate (who are also our peers, but not usually available to us). I both took part in the networking and stood back and watched it happen. I love seeing a bunch of data pro's sitting (or standing) in a circle exchanging war stories, ideas, questions, thoughts or suggestions. It means you…
Read More

You should NOT attend the PASS Summit

If you asked me, prior to today, if I would type or say those words, I would have laughed right at you. But then, I saw this question on Ask SQL Server Central. It's from a college student, not yet twenty-one, who was considering paying his (assuming it's a guy since their handle is 'Eagle Scout') own way to the Summit and wondered if it would be worth it. It pains me to say that I suggested that he not do it. Don't get me wrong. I think the PASS Summit is probably the single greatest resource you have to advance your career. Where else can you go to get that broad a choice in training? Where else can you go to get that many of the leaders of our industry, specializing…
Read More

What Should PASS Be?

Andy Warren posted a question the other day (well, issued a challenge actually), “What Should PASS Be?” I’ll let you go and read that & wait here… Done? Cool. Moving on. I have thoroughly enjoyed my associations with PASS over the years. I’ve been a first-time attendee, a volunteer and a presenter at the PASS Summit. I’ve volunteered with the PASS organization with the Special Interest Groups, the Editorial Committee, and as Editor of the SQL Standard. I’ve taken part in 24 Hours of PASS as a presenter, host and attendee. I have helped to put on SQL Saturday events, attended them and presented at them (and we have another one coming up on April 2nd in the Boston area, please register here.). I was one of the founding officers…
Read More