Webinar: Unlock the Full Potential of Flyway to Achieve Automated Database Releases

On Aug 22, 2023, I’m co-hosting a webinar with Anderson Rangel, Redgate Solution Engineer in Brisbane. You can register here for the 11am AEST webinar.

No, I’m not going to Brisbane. I’d love to, but I’ll be in Colorado and hopefully I keep things straight that this is the day before for me. I’ve got a few reminders to keep me on track that I’ll be speaking after dinner in the US.

We’re going to cover the ways in which Flyway can help you automate your database releases. If you haven’t looked at Flyway recently, or ever, this is the webinar for you in the Australia / New Zealand region. We will look at why Flyway helps and some of the new features and changes Redgate has added with our many releases. If you look at the release notes, we release a lot, often in response to feedback from our customers.

Join us on the 22nd and learn how Flyway and Flyway Desktop can help you prevent the database from being a blocker to adopting DevOps for your software.

Register today

Posted in Blog | Tagged , , | Comments Off on Webinar: Unlock the Full Potential of Flyway to Achieve Automated Database Releases

The 2023 Redgate UK DevOps Roadshow

Years ago Redgate did some traveling events under the SQL in the City brand. These were a lot of fun and kind of amazing. One of the longer tours also made me realize I would hate being in a musical band and touring.

However, I enjoyed the events and while we’ve moved on from that brand, we have a new one

The Redgate DevOps Roadshow

The UK edition of this kicks off in September 2023 and I’ll be in these cities:

I’ll be traveling with one of our Sales Engineers (Chris Hawkins, I hope), and doing will day sessions for customers on the Flyway suite of tools. You’ll get some practice, learn how things work, and get answers to your questions. Hopefully that day, but if Chris and I don’t know, we’ll query the brilliant engineers back in Cambridge.

If you’ve ever attended a Redgate event, you know we put on a nice show, we take care of you, you’ll have plenty to eat and drink, and we have fun.

Hopefully I’ll see some of you in September in the UK.

Keep watching as well as we’re working on a US edition of this. I’ll do some of these, while Grant and Ryan will do others. I’ll keep my schedule updated as I get more info.

Posted in Blog | Tagged , , , , | 1 Comment

How Wrong is Stack Overflow?

I chose the title slightly to poke at Stack Overflow (SO), but the same take expressed in this tweet could be said about SQL Server Central. It’s not quite the same as anyone can answer questions on SQL Server Central.

The tweet is a (long) hot take from Jerry Nixon, a C# developer and MS evangelist in Denver. Essentially he says that a lot of the SO answers are wrong, especially as the software and languages change. Old answers are upvoted, and remain at the top of the list, even as newer answers might be better. People don’t like the behavior on SO of moderators and people who post, which is something we’ve tried to avoid or limit here at SQL Server Central. We want there to be professional discussions. SO also doesn’t allow much discussion or nuance in the questions or answers.

This isn’t just a SO problem or am SSC one. It’s a problem when we have lots of documentation, blogs, etc. on the Internet that search engines find and surface when it’s popular. Across time, these popular outdated posts remain, just like older documentation that doesn’t apply to a current version and this can be frustrating. I am even starting to get annoyed by the MS Learn docs for SQL Server as some functionality change across versions. It isn’t easy to determine what applies to which version, especially when subtle changes are made in how things work. If something is new, usually that’s clear, but when things change, it isn’t. The examples aren’t well maintained, or there are too many of them to really understand how and why a change in versions can affect your code.

I do wonder if we ought to somehow limit content that we see by default to more recent content. Or maybe Google/Bing/et al ought to let us set that as a preference. In general, I want more recent content, but at the same time, I don’t want to say “give me blogs about something from the last month only.” It’s possible I use something that’s rare and the most recent blog is 7 months old.

More, I wish we had better ways to tag content online as relevant for certain things or not. I can’t think about the entire world and all the different types of content, but I can think about technology and software. I’d like to know if someone write a highly popular and useful post on PowerShell 5 that was written and tested on that version. I can understand that it’s not necessarily tested on PoSh 7, though it could work. It could even be the best solution. The same thing applies to Python 3.8 or T-SQL for SQL 2016 or any other software.

The challenge of keeping things up to date is a big one, especially as more companies move to release software more often. I’m always pointing out issues in the RG docs. Since we release every week or two, each product team has a busy job in ensuring documents are up to date, which is easy for the reference pages. This is a bit harder when there are articles were we explain how to use a feature or we have a walkthrough of the software. I don’t know if AI will help here, but I do think this is a place where AI might be able to help vendors at least keep up with changes. When code changes, update docs, all the docs including examples.

I do also think dating content is important. Microsoft tried to stop doing this with some things and many people complained. Content needs a date. It might still be valid or useful, but without a date, we have no idea of the context in which it was produced. That might help us decide if it’s still relevant, useful, or if we need to continue searching further.

Steve Jones

Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

Posted in Editorial | Tagged | 3 Comments

Finding Encrypted Stored Procedures–#SQLNewBlogger

I had a client ask about how to deal with encrypted stored procedures in their database. This post looks at how to find them and I’ll have future posts that show how to decrypt these and also how Flyway helps.

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

The Scenario

A client was trying to start putting their code in a VCS, but they ran into the issue that they had procedures which were encrypted. In their case someone had done this in the past and the current staff wanted to know how to get the code from production.

As a setup, here are two procs I’ve created that are encrypted:

CREATE PROCEDURE EncryptedOne WITH ENCRYPTION
AS
SELECT 1 AS One
GO
CREATE PROCEDURE EncryptedTwo WITH ENCRYPTION
AS
BEGIN
     DECLARE @i INT = 1;
     WHILE @i < 100
     BEGIN
         SELECT @i = @i + 1
     END
     SELECT @i / 50
END

These two procs don’t do anything weird, but if I try to script them like this in SSMS:

2023-07-11 15_43_19-SQLQuery4.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (65))_ - Microsoft SQL Server

I get an error:

2023-07-11 15_43_31-Microsoft SQL Server Management Studio

The error says that the text for the procedure is NULL.

The text is stored in the sys.syscomments DMV, which we can see below. This is the text that was submitted for procedures without the WITH ENCRYPTION. You can also see a NULL entry for the procedures I created above.

2023-07-11 15_46_56-SQLQuery4.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (65))_ - Microsoft SQL Server

I can filter on this with a

  WHERE [text] IS NULL

Or I could use ObjectProperty(). This has an IsEncryted parameter I can send in with this code:

select name, OBJECTPROPERTY(object_id, 'IsEncrypted') AS Encrypted, OBJECT_DEFINITION(object_id) AS Code
from sys.procedures
WHERE OBJECTPROPERTY(object_id, 'IsEncrypted') = 1

Of course the text column isn’t needed as all the code is null here. If I wanted just a list, I’d likely only have the first two columns.

That’s it. With this script I can see those procs which are encrypted. In my case, it’s four.

2023-07-11 15_54_48-SQLQuery4.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (65))_ - Microsoft SQL Server

SQL New Blogger

This is a quick post that shows how to find those procedures (or views) which were created with WITH ENCRPTION. I’ve run into this a few times and while this is a focused, small post, I also took the opportunity to break this into multiple posts rather than doing just one long one.

You could do this as well and showcase how you break a problem down. This took me about 10 minutes to do this post.

Posted in Blog | Tagged , , , | 2 Comments