Tag: Redgate

  • Using SQL Compare to Revert a Stored Procedure

    Imagine this situation, someone edits a stored procedure on a production server to “fix” something. However, they broke the procedure and you find out the next day. How do you fix this?

    We’ll use SQL Compare since most of you don’t have version control (according to surveys), but you do (hopefully ) have backups. Let’s see how SQL Compare can help.

    This is part of a series of posts on SQL Compare.

    The Scenario

    I get a call one morning that we have problems with a report. This report wasn’t producing the expected values. A user said they saw this:

    2025-06_0134

    However,the value the day before had been 2301.54. What was wrong?

    Checking with SQL Compare

    When I hear this, I think immediately two things:

    1. the data changed
    2. the code changed

    Either is possible, but data is most likely. In this case, when I inquired, the user said no new orders were in the system. While I think humans can easily make mistakes when checking data, code is a possibility.

    I asked people, but no one responded with a change being made. So let’s check. I know I have backups, so when I run SQL Compare, I change the source to a backup.

    2025-06_0135

    Next, I pick the “add backup files”

    2025-06_0136

    I choose my file(s) and confirm they are correct. In this case, just one file. I set the target to my database.

    2025-06_0138

    I run the comparison, and I see this. There are a few changes, but the one I’m looking for is my procedure. You can see the code is different.

    2025-06_0139

    Arguably, the new code is more correct, but if I need to revert, I can click the deploy button at the top. I’ll want to also just select the SalesReport item.

    2025-06_0140

    This will produce a script that I can run in SSMS. I can also just let SQL Compare run this. Note the old code is in the script.

    2025-06_0141

    Once I run this, the report works, or at least returns the expected results.

    2025-06_0133

    Summary

    This is a short demo of using a backup as a comparison source against a database to revert code. In this case, I can see the old code and get that back to ensure my database functions as expected..

    SQL Compare is an amazing tool that millions of users have enjoyed for 25 years. If you’ve never tried it, give it an eval today and see what you think.

  • The PASS Summit on Tour in the Netherlands

    The PASS Summit goes on tour this year, with the final date the first few days of October  in the Netherlands, Utrect to be exact. This is the first event in the series, and I’m excited to go back to New York City for the event. You can register here and come see some amazing speakers on Oct 1-2, 2025.

    2025-06_line0088

    The lineup is small and short, but it’s a one pre-con day with two half-day sessions and then a one full day of hour long sessions. The pre-cons include Fabric, leadership, performance tuning and more. All from industry experts. The regular sessions are across four tracks with a variety of things you can learn during the 5 time slots throughout the day.

    There is also a Redgate Summit on Friday. That’s got Redgate specific content, but if you’re interested (or a customer), stay an extra day for that as well.

    If you’re near Dallas, or can convince your boss to send you, register today and join us on tour. The larger main event is still in Seattle, and if you prefer that, come for a full week in November.

  • The PASS Summit on Tour in Dallas

    The PASS Summit goes on tour this year, with a September stop in Dallas. This is the first event in the series, and I’m excited to go back to New York City for the event. You can register here and come see some amazing speakers on Sep 15-16, 2025.

    2025-06_line0086

    The lineup is small and short, but it’s a one pre-con day with two half-day sessions and then a one full day of hour long sessions. The pre-cons include Fabric, leadership, performance tuning and more. All from industry experts. The regular sessions are across four tracks with a variety of things you can learn during the 5 time slots throughout the day.

    There is also a Redgate Summit in Dallas on Wednesday. That’s got Redgate specific content, but if you’re interested (or a customer), stay an extra day for that as well.

    If you’re near Dallas, or can convince your boss to send you, register today and join us on tour. The larger main event is still in Seattle, and if you prefer that, come for a full week in November.

  • The Book of Redgate: Motivation

    Another of our values is this:

    Motivation isn’t about carrots and sticks.

    Constant oversight and the threat of punishment are incompatible with great, fulfilling work. We believe in creating appropriate constraints and then giving people the freedom to excel.

    We do have some rules, bumpers, guidelines, and limits on what people can do. We’ve added a few since 2010 as the company has grown and lots of people might not have the culture ingrained.

    However, we try hard to let people get work done, expect them to do so, and have a few reminders, but without the thread of punishment.

    At the same time our bonus or recognition strategies are mostly around group goals or company goals. We don’t push people to compete with each other to get a bigger bonus than someone else.

    That was strange to me, coming from US companies, but I have found it more refreshing. There are some commission aspects for individuals, but for most of us outside of sales, we’re all in this together.

    I have a copy of the Book of Redgate from 2010. This was a book we produced internally about the company after 10 years in existence. At that time, I’d been there for about 3 years, and it was interesting to learn a some things about the company. This series of posts looks back at the Book of Redgate 15 years later.