Tag: Redgate

  • BBQ in Dallas (and a little database talk)

    Who wants to get some great BBQ in Dallas next month? Last time I was there, I went to Terry Black’s BBQ. It was amazing.

    bbq

    In just a couple of weeks the PASS Data Community Summit goes on Tour in Dallas, with 2 days of learning on Monday and Tuesday. The next day is the Redgate Software Summit, where we discuss lots of important and pertinent topics with myself, fellow advocates, and industry experts. We also have a separate track for Redgate software demos, tutorials, and presentations.

    Come join me at one or both events, and tell your co-workers. It will be a fun few days in Dallas. I don’t know if I’ll get to Terry Black’s, but I’ll be looking for some pit BBQ.

  • The Book of Redgate: Meetings

    I think we might have forgotten this a bit, but on one of the pages, we have this title: A Meeting without an Objective is a Chat.

    You can see it below, with a few funny things.

    2025-05_0113

    I don’t get too many meetings, at least not too often when I’m working remote. When I’m in the office, I’m usually there for meetings, and if I get 5, 6, or more a day, that’s fine.

    I do think that most of the meetings I’m involved in (outside of sales) are worthwhile and helpful. They tend to focus on topics or work that needs collaboration in real time. There can be a few that get scheduled and aren’t needed, but I find lots of people quick to end meetings early and not trying to draw them out for the scheduled length.

    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.

  • Monday Monitor Tips: Searching Procedures

    A customer was asking about how to track all the stored procedures that execute on their system. We have a section in Redgate Monitor that’s set to look at stored procedures, and you can easily find information about them.

    This is part of a series of posts on Redgate Monitor. Click to see the other posts.

    Finding Stored Procedures

    If I go to the SQLServerCentral_Test system on monitor.red-gate.com, I can scroll down and see the top queries for the time period selected. Here’s an example of a query. The main query window shows SQL, but these are parts of procs.

    2025-05_0124

    If I expand to the full query, we see this is part of a proc. That’s good, in that if the query causing problems is part of a procedure, I can track that down.

    2025-05_0125

    However, what if I know people are reporting a problem that is related to this proc. Can I find it knowing the name? I can’t in the Top Queries.

    2025-06_line0098

    However, we’ve added a Top procedures item to the right. That’s the place to focus on if you use stored procedures. And you should, since they create a looser coupling between your schema and the various business things your app needs to do.

    2025-06_line0096

    On this test system, there are relatively few procedures running, but on many systems in production, this is a large list of things. To the right (not shown) there are various metrics that help you determine which of these items might be stressing your system because of execution counts, duration, CPU, etc.

    2025-05_0123

    If I know I have a procedure, I can search using the box. Here, I’m searching for UserA, but you might be searching for FinanceReport, hoping to find which of the FinanceReport_A, FinanceReport_B, FinanceRepot_Prep, etc. procs is using resources.

    2025-05_0122

    Expanding any of these (clicking the arrow) gives you more detail, as you would get in the Top Queries section.

    Summary

    Tracking down which queries are stressing your system and why can be hard. We added the focus on procedures as this is an easier way for some customers to determine what part of their workload is causing issues. In the top queries, sometimes procedures get lost, so this section lets you drill down into how your system is performing.

    Redgate Monitor is a world class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.

  • 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.