Static Code Analysis Feedback for Operations with SQL Monitor

One of the challenges with managing a production database is that the code that gets deployed sometimes causes lots of problems. Often a production DBA or sysadmin gets called about problems that they didn’t cause, and can’t necessarily fix.

Helping developers learn what the impact of their code is, and if it is following good practices, is something many of us would like to do, but often don’t have the time, or a good report that we can easily pass on.

I saw recently that the SQL Monitor team had deployed a new feature to the product that makes this a bit easier. They have incorporated the code analysis from SQL Prompt into SQL Monitor, which you can see at  https://monitor.red-gate.com/overviews/sqlmon-vmw-bm.red-gate.com/cluster/workload01.smdemo.local/sql/demo#?Zoom=1619213137440%2C1619220337440&MaxTime=1619220337440&Present=true

I’ve linked to one of the workload demo systems being monitored. If you look at the top 10 queries, and pick one, you’ll see something like this:

2021-04-23 17_26_30-demo - Server Overview — Mozilla Firefox

Just below the query text, there is a blue lightbulb (for a new feature) and the text: SQL Monitor has identified 2 issues with this query. Addressing them could improve performance.

Clicking the link gives you the issues. In this case, these are code smells that I’d want a developer to address. Having a TOP without any ordering could confuse clients, but it also might mean we are gathering the wrong data, since there isn’t a guarantee on which 10 rows come back.

2021-04-23 17_26_41-demo - Server Overview — Mozilla Firefox 

You can screen shot this, or send this link to developers, and ask them to fix this code for the next deployment.

SQL Monitor has become an impressive product over the years, and with multiple teams adding to it now, it is constantly evolving to meet the needs of our customers. If you haven’t tried it, consider an evaluation before you purchase a monitoring tool (or before you build one).

Posted in Blog | Tagged , , | Comments Off on Static Code Analysis Feedback for Operations with SQL Monitor

Daily Coping 3 May 2021

I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

Today’s tip is to go outside and spend a few minutes appreciating the weather.

It’s spring here, though I know the Southern Hemisphere is preparing for winter. In either case, I suspect most of us don’t have extreme weather on some of these days, so getting outside should be possible. I had a 25C day and a –10C day in the same week not long ago, and I took advantage of the 25C day to get out, do a few things outside, and enjoy the day.

I also walked around in the –10C day, bundled up, but enjoying the snow coming down. It’s a beautiful sight when the ground gets covered, especially without much wind. Wind makes things much worse.

However, the weather is one of those things that helps me appreciate how big and amazing the world is, and taking a moment to enjoy it, no matter what is happening, is a part of life I’ve learned to appreciate.

Update: Today I drop to 3 newsletters a week at SQLServerCentral, as a way of coping a bit. I’ll still do daily coping tips here.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 3 May 2021

No-code Software Engineering

Low and no code applications have been around for a long time. In my career, I’ve seen Access, Delphi, PowerBuilder, and various 4GL packages used to build software for business users. Some worked well, some didn’t, and often many didn’t scale. Not all, but many.

The problems in many of these tools, at least to me, was that many of the “developers” using them weren’t developers. They were business people trying to get something done quickly. Often these weren’t people thinking about performance or software engineering in the way that many developers think of those topics.

Arguably, there are plenty of Java, C#, and other developers that don’t think things through either. However, many developers do want to solve problems and build interesting solutions. They don’t (often) want the drudgery of moving around UI elements or reinventing CRUD data operations.

I saw an interesting piece this week noting that No-code doesn’t mean we avoid software engineering. The author praises some of the no-code platforms because they allow developers to do the fun part of building logic and solving problems without the tedious nature of writing an IF statement with the correct syntax. There are a number of reasons given, which sound good.

I don’t know that I think that no-code is the way to go, but I do get the idea of using lots of proven and tested components, features, services, and more rather than reinventing them. I think that connections to database objects, RDBMS or NoSQL, ought to be easy, and lots of the mundane work of plumbing systems together could be centralized and reused. I certainly think that LINQ or simple query languages make sense, though likely having a way to more quickly and easily build/test/refactor and deploy database methods as well as make them more flexible (select col from @table, anyone?) might simplify database coding.

I doubt we’ll get rid of C#, Java, or other fairly low level code anytime soon. I write about better programming languages recently, and I can see us moving to more succinct languages over time, but that will take decades. There is far too much invested in current codebases by developers and organizations to think about quick switches.

The best way to build better applications is to have developers continue to learn, practice, test, and change their coding. They need to seek to be better, which I think most of them do, but management and leaders need to demand this and invest in staff (time and money) to help them improve. Then I suspect that whether you use lots of code or none, all your applications will work better.

Steve Jones

Posted in Editorial | Tagged , , | 2 Comments

Remote Work

This is going to be the first time I’m working remotely today in over a year. I’m in Omaha, and while I’ve gone to a few cities, I haven’t actually worked remotely on a trip in over a year. I did broadcast from my condo in the mountains last summer, but that was because there was too much noise at home from some construction.

However, this time I had a few meetings I can’t avoid and didn’t want to move. I have to coach later today, but I had time this morning, so I decided to not take holiday and work. I’ll have to do a little other work this weekend to make up time, but that’s fine.

It’s interesting working in a hotel again, and carrying all the things I need to work. Laptop, cords, headphones, mouse. Actually, I forgot my mouse since I dropped the laptop in my coaches bag, so I’m dealing with a trackpad.

It’s a pain, but I am looking forward to being able to get to an office again. It looks like that might be possible later this year, and my fingers are crossed.

Posted in Blog | Tagged , , | Comments Off on Remote Work