Author: way0utwest

  • Creating a Quick Dashboard Widget

    I read Carlos Robles blog on creating an Azure Data Studio (ADS) insight widget and decided to try this for myself. I decided to try and get a list of object types and a count of each. Following instructions, here’s what I did.

    First, I wrote a query that would gather the types of objects and counts from sys.objects.

    2018-10-20 16_41_15-UserObjectCount.sql - Azure Data Studio

    I saved this as a file under my Documents folder. Once I had this, I ran the query and in the results, I clicked on the Chart item to the right of the results.

    2018-10-20 17_01_52-UserObjectCount.sql - Azure Data Studio

    This displays a bar chart, which is useful at times, but that’s not what I want.

    2018-10-20 17_02_02-UserObjectCount.sql - Azure Data Studio

    Instead of this, I’ll expand the Chart Type drop down. This gives me a list of a number of items I can choose. For this insight, I’ll use the table type.

    2018-10-20 16_41_30-UserObjectCount.sql - Azure Data Studio

    Once this is done, I’ll see the results I want. There is a “Create Insight” button above the chart. I’ll click this to get the JSON code that creates this.

    2018-10-20 16_41_23-UserObjectCount.sql - Azure Data Studio

    A new editor tab opens with the JSON code in it. This is just one long line of code, which isn’t as helpful or easy to work with.

    2018-10-20 16_50_48-Untitled-2 - Azure Data Studio

    CTRL+Shift+P opens the command palette. Type “format” and you’ll see the Format Document command. Once you format the code, it will be easier to read.

    2018-10-20 16_51_06-● Untitled-2 - Azure Data Studio

    The next step is to open the user settings. This is also in the command palette.

    2018-10-20 16_49_47-2017Sandbox_sandbox - Azure Data Studio

    In my ADS, I get the settings list. I can search for dashboard and I’ll find the one I want.

    2018-10-20 16_50_07-settings.json - Azure Data Studio

    If I put the cursor in the upper left, I’ll get an edit item. I can pick this and I’ll get one of two items. If I’ve never customized anything, I’ll get the “copy to user settings” option. If I have, I get the “Replace in settings” item.

    2018-10-20 16_50_15-settings.json - Azure Data Studio

    Once I’ve done this, I want to modify some code. I don’t love the search box, so I’ll delete that json widget. Then I paste in my widget code. Be sure you put this in the right place, with a comma between the widgets braces. I changed the name from “my-widget” to “User Object Count”.

    2018-10-20 17_11_36-settings.json - Azure Data Studio

    Once I do this, I save it and close it. Then I double click one of my server connections and I see my widget on the dashboard.

    2018-10-20 16_57_11-SimpleTalk Dev 2014_SimpleTalk_1_Dev - Azure Data Studio

    Pretty easy to get a query to appear on your dashboard as a chart if you want to get some insights. Any query could be used, with the results returned when you open the server connection. You can also leave the dashboard open and refresh it when convenient.

  • Wasted Work

    I’ve been re-reading some of the manufacturing and DevOps books that I’ve collected over the years. In these texts, there are a number of concepts that stand out, but one that resonates with me is the concept of waste. There’s actually a good article on LinkedIn about waste that’s worth reading as well. While it’s easy to start spinning in circles and thinking everything is waste around you, step back and keep some perspective that some waste is inevitable because the world is messy. Don’t get too caught up in waste, but try to reduce waste where you can.

    One of the areas that I think contains a lot of waste in software development is the effort to build features that won’t be used. Like many of you, I have been asked for no shortage of changes to software in the past. Often those changes require both application and database changes, usually to support a new way of conducting business.

    The interesting thing to me is that often I’ll work my through a queue and get changes completed, a percentage of which rarely, or even never, get used. What seemed like a good idea when it was requested, specified, and scheduled may not be a good idea weeks or months later.

    In other cases the latest request is labeled as important and needing to be completed ASAP. This might displace older work, perhaps even pushing it to the lowest priority level where it may never get completed. That’s fine, as if the work isn’t important enough to be pushed by someone, perhaps it isn’t needed.

    To me, this is one of the advantages of working in a DevOps style flow, with small changes being developed and released. If clients start to use the feature and need additional development, we can continue to enhance the feature. If the users don’t use it, which we know from either future requests or instrumentation (the latter is preferred), then we can put more effort into the areas that are more important to our organization.

    With less waste.

    We don’t work on large projects to completion, wasting work on the parts of projects that will not be used. Instead, we complete small parts and keep shifting our focus to the areas that are most important to clients.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 4.7MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • A Busy Summit

    I’m only at the PASS Summit for two days, but they will be busy. If you’re at the event and want to find me, here’s my schedule. If you do see me, please feel free to say hi. If I can’t stop to chat for long, it’s because I’m likely late for something, but I do want to shake hands.

    Thursday

    Lunch: I’ll arrive mid morning and get myself checked in. I don’t know if I’ll be in the lunch area, but I’ll likely stop by the Redgate booth.

    1:30-3:00 – Branding Yourself for a Dream Job, Rm 612. I’ve done this at the Summit before, and a number of other events, but people like it, so I got picked to do it again. I’ll talk about some practical ways to brand yourself and take control of your career.

    3:00-6:00 – I’ll likely go to a few sessions or meet friends, but I should be around the expo area part of the time.

    Dinner with friends later and an early night for me.

    Friday

    Early morning will be final rehearsal and prep for me. I’ll do some early in the week, but I like to practice my timing again, especially for my second session.

    11:00-12:30 – Adopting a Compliant Database DevOps Process, Room 606. I did a version of this last year and people really liked it, so I’m back again. I’ll talk process and how you can do DevOps in the database, and will show demos, but really this is a process talk. The details of the demos don’t matter, but you get to see changes flowing through the system with a few taps of a finger.

    Lunch – Expo hall for me.

    15:30-17:00 – Minimizing the Impact of Data Breaches in Dev and Test Databases, Room 604. A higher level talk, mostly aimed at convincing you to be more careful with data. No real demos here, mostly just a talk that looks at how and why you need to protect data.

    17:15 – I’m off, heading to the airport. As I mentioned, a short summit for me.