Categories
SQL Server

Dealing with Multiple Database Snapshots

Last week we looked at using Database Snapshots to help with rolling back upgrades. The snapshot maintained a point in time copy of the database which could be later restored. We can go further – a database can have multiple snapshots. Let’s suppose we want to take one before an upgrade, another once the upgrade is […]

Categories
SQL Server

Using Database Snapshots for Peace of Mind Upgrades

Deploying database changes are relatively easy. Where things get complicated is the rollback. Sure, it’s easy to script out and revert a procedure to a previous version, but what about destructive changes? In this post we’ll look at how we can use Database Snapshots to remove some of the headache that comes with rolling back […]

Categories
SQL

Implementing Logging for Rollbacks

Last time out we looked at how data can be persisted even with a ROLLBACK being executed. Here we’re going to take that and look at an example of using it in action. We’ll generate some data – which may be good or bad – and try to add it to a table. If there’s any bad data […]

Categories
SQL Server

Persisting Data Following Rollback

We recently looked at the impact of rolling back transactions on statistics and I thought it would be worth following this up to look at some other objects to see how they behave when a rollback occurs. When rolling back transactions we expect any changes to be rolled back. This isn’t always the case with data, just […]

Categories
SQL Server

Impact on Statistics of Rolling Back Transactions

I recently saw an Office Hours (at sea) Q&A from Brent where he was asked if statistics were rolled back along with a transaction. It’s a great question which I’d never come across so thought it would be worth looking into. TL;DR: They aren’t, but they may need to be updated when the data is next queried. […]