sp_restorescript v1.3 is now available. We had found instances where backups consisting of multiple backup files were causing the length of the restore command to exceed the maximum character limit. 1.3 deals with this problems. Please visit https://sqlundercover.com/2017/06/29/undercover-toolbox-sp_restorescript-a-painless-way-to-generate-sql-server-database-restore-scripts/ for full documentation on sp_restorescript The procedure can also be downloaded from out GitHub site https://github.com/SQLUndercover/UndercoverToolbox/blob/master/sp_restorescript.sql
To use ALTER DATABASE, the database must be in a writable state in which a checkpoint can be executed. – when moving files on an Availability Group secondary.
Here's a little error that I stumbled across the other day when trying to migrate the data files of an Availability Group secondary node onto a nice new SAN. I started off by running the following command against the secondary server. ALTER DATABASE SQLUndercover MODIFY FILE (NAME = 'AG01', FILENAME = 'E:\DATA\AG01.mdf') There's nothing wrong... Continue Reading →
Is Your Availability Group ‘REALLY’ Ready To Failover?
You know what it's like, you need to fail your AG over but is it safe to fail over? Perhaps you've clicked on 'failover' for the AG and there's a little green tick and no data loss reported... Or maybe you've checked out sys.dm_hadr_database_replica_cluster_states and 'is_failover_ready' is reporting a 1. So, you're cool to failover,... Continue Reading →
Why Rolling back inserts with Identity columns is a bad idea.
It wasn't until the other day that I realised what the behaviour was when rolling back a transaction with an insert on a table with an identity column, to be fair I have never had a need to do so but I know that there are people who like to run code like below to... Continue Reading →
#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 from them. Cookie One: is remembering... Continue Reading →
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 like everyone I've had... Continue Reading →
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? Let's create a rather simple,... Continue Reading →
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 always handy to have a few little... Continue Reading →
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 mis-recorded. Version 0.2.1 fixes both... Continue Reading →
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 trying to run an ALTER... Continue Reading →
