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

SQL Undercover

David Fowler and Adrian Buckman, two database nerds who love nothing more than to spend their time, reading about, researching and sharing all things SQL Server. David is a DBA with over 15 years production experience of SQL Server, from version 6.5 through to 2016. He has worked in a number of different settings and is currently the technical lead at one of the largest software companies in the UK. After working in the motor trade for over 11 years Adrian decided to give it all up to persue a dream of working in I.T. Adrian has over 3 years of experience working with SQL server and loves all things SQL, Adrian currently works as a Database Administrator for one of the UK’s Largest Software Companies.

#TSQL2sDay – #112 – Mini cookies

This months TSQL Tuesday is hosted by Shane O’Neill (Blog | Twitter) Shane explains the Topic as:
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… Read more

1 comments, 113 reads

Posted in SQL Undercover on 12 March 2019

TSQL Tuesday #112 – Dipping into the Cookie Jar

This month’s TSQL Tuesday comes from Shane O’Neil and he’s asking us to ‘dip into the cookie jar’ (or raid the biscuit tin, for us Brits ), essentially how we use past accomplishments to help us through difficult or challenging times.

I’ve been trying to think about this and while… Read more

1 comments, 78 reads

Posted in SQL Undercover on 12 March 2019

Using Indexing To Solve Blocking and Deadlocking Issues

A while back, I was having a conversation about a deadlocking issue and suggested that an index could perhaps help solve it. The reaction I got was along the lines of, ‘What, how can in index solve a deadlocking issue?’

So, can we solve a deadlocking issue with an index? Read more

7 comments, 2,585 reads

Posted in SQL Undercover on 5 March 2019

Undercover TV – Sean McCown Joins Us For a Session on Beginning Powershell SMO

In this episode, Adrian looks at some of the new features of the Undercover Inspector1.3 and special guest, Sean McCown give us a fantastic intro into the Powershell SMO (0:23:20). All Sean’s scripts can be found at on Git Hub at https://github.com/SQLUndercover/UndercoverToolbox/tree/master/Undercover%20TV%20Scripts/BeginningSMO

Read more

0 comments, 147 reads

Posted in SQL Undercover on 26 February 2019

7 more ways to Query Always on Availability groups

Post Updated: Replaced Query 3 with transactions/sec query.

When we first published 7 ways to Query Always On Availability Groups using SQL we had no idea it would so popular! So here is a quick post with 7 more ways to query Always on availability groups using TSQL,  its… Read more

1 comments, 147 reads

Posted in SQL Undercover on 19 February 2019

Undercover Catalogue 0.2.1, Fixes An Issue With The Recording Of Unicode And MAX Datatype Lengths

Please see https://sqlundercover.com/undercover-catalogue-0-2/ for full details on the Undercover Catalogue and how to obtain it.

We’ve spotted an issue where unicode datatypes were having their size recorded as the data length rather than character count in the ‘Tables’ module. Another issue affected any MAX datatypes which were having their length… Read more

0 comments, 110 reads

Posted in SQL Undercover on 14 February 2019

ALTER TABLE Fails on Replicated Tables With Isolation Level SERIALIZABLE or READ UNCOMMITTED on SQL2012 and Earlier

It’s 4am in the morning and my phone starts ringing.

A blury eyed, me picks it up to hear the voice of one of our application guys at the other end saying something about an upgrade he was trying to carry out failing.

So it turns out that he was… Read more

0 comments, 133 reads

Posted in SQL Undercover on 7 February 2019

Undercover Catalogue 0.2 Released

We’re pleased to announce the release of the Undercover Catalogue 0.2 and can be downloaded from https://github.com/SQLUndercover/UndercoverToolbox/tree/master/SQLUndercoverCatalogue

The new version brings with it a number of new modules as well as the thing that we’re most excited about, a Power Bi dashboard to make keeping track of your SQL Server… Read more

1 comments, 117 reads

Posted in SQL Undercover on 4 February 2019

Inspector V1.3 hotfix

Unfortunately we discovered a small bug in 1.3, the Database ownership module default warning level was not showing a yellow advisory condition when using the Inspector default warning level (NULL), we have now updated Git with the latest revision.

If you would rather not re install 1.3 again you can… Read more

0 comments, 163 reads

Posted in SQL Undercover on 16 January 2019

Inspector V1.3 now available

Inspector V1.3 is now available on GitHub.

We have updated the sample report for you to play with which includes the new informational section added in this build.

We updated our getting started guide.

We know some of you really hate linked servers so we have been working… Read more

2 comments, 137 reads

Posted in SQL Undercover on 15 January 2019

Availability Groups: When Your Synchronous Secondary isn’t Synchronous

During a recent DR scenario I came across a slight misinterpretation in how availability groups with replicas in synchronous commit behave.

How An Availability Group With A Synchronous Secondary Should Behave Under Normal Circumstances

Normally, if we’ve got a secondary replica in synchronous commit mode, our primary can’t commit any… Read more

1 comments, 2,023 reads

Posted in SQL Undercover on 14 January 2019

Happy New Year, Here are our Most Popular Posts of 2018

Firstly, all of us at SQL Undercover would like to wish you a very Happy New Year and all the best for 2019.

To sign off for the year, here’s a quick run down of the most popular posts from SQL Undercover in 2018.

Thanks to everyone who’s supported us… Read more

0 comments, 223 reads

Posted in SQL Undercover on 31 December 2018

Quickly Compare Data in Two Tables Using CHECKSUM and CHECKSUM_AGG

There are times when we need to compare two tables and figure out if the data matches. I often see a number of ways of doing this suggested, most are quite slow and inefficient. I’d quite like to share a quick and slightly dirty way of doing this using the… Read more

5 comments, 2,743 reads

Posted in SQL Undercover on 18 December 2018

Managing Logins and Users Across An Availability Group

What’s the deal with logins and availability groups?

I’m sure that we all, when creating a login that accesses a database that happens to be part of an availability group, diligently go and create that login on all secondary replicas, don’t we?!

Of course, when that AG fails over to… Read more

1 comments, 2,088 reads

Posted in SQL Undercover on 5 December 2018

A curious case of case when and Null values

For some reason I have always written my Case statements using the following logic:

	WHEN @Priority = 1 THEN 'Very High'
	WHEN @Priority = 2 THEN 'High'
	WHEN @Priority = 3 THEN 'Medium'
	WHEN @Priority = 4 THEN 'Low'


It wasn’t until recently that… Read more

5 comments, 2,726 reads

Posted in SQL Undercover on 28 November 2018

High CPU and Query Store, A Story of Spinlock Heartache

This is going to be a quick look at an issue that we recently encountered, I’m not going to go in depth into spinlocks and what they are (perhaps that could be the subject of a future post).

We were enjoying a nice peaceful afternoon when we hear panicked shouting… Read more

2 comments, 2,282 reads

Posted in SQL Undercover on 20 November 2018

T-SQL Tuesday – Non-SQL Server Technologies

So, this month’s T-SQL Tuesday topic is to think about a non-SQL Server technology that we want to learn.

For me, I’m going to pick machine learning.

As a DBA, I’ve always looked at machine learning as a thing for the BI guys.  I’m a DBA after all why do… Read more

0 comments, 2,146 reads

Posted in SQL Undercover on 6 November 2018

Signing Stored Procedures That Access Multiple Databases

A while back I wrote a post, Digitally Signing a Stored Procedure To Allow It To Run With Elevated Permissions

Recently Manish Kumar asked an interesting question, what do you do if your proc accesses multiple or even all the databases on the server?

So, instead of giving him a… Read more

2 comments, 2,506 reads

Posted in SQL Undercover on 30 October 2018

Identifying delays between SQL calls using SQL profiler

One of the common goto methods for query specific slowness which can be replicated via an application can be to start up a trace or extended events session whilst replicating the issue, we all know about the dangers of running these sessions without sufficient filtering so ensuring that correct filtering… Read more

0 comments, 2,140 reads

Posted in SQL Undercover on 24 October 2018

A Play Around With Table Variable Deferred Compilation in SQL 2019

Table variables, they’re nasty, dirty little things that perform about as well as a Robin Reliant in a crosswind, right?  Well you’re not going to have me argue with you there.

But how many of us have got these little beasts floating around in their production code with absolutely nothing… Read more

0 comments, 1,986 reads

Posted in SQL Undercover on 16 October 2018

Older posts