Author: way0utwest

  • Reaching the Refactoring Redoubt with #SQLPrompt

    I enjoy themes, and when I ran across the SQL Prompt Treasure Island, I had to take a few minutes and go through it. I wrote about Code Snippet Cove first, and this post finishes my movement around the map. The other items I’ve read about are:

    Refactoring is Hard

    One of the things that I struggle with, and I think many others do as well, is refactoring. Not that refactoring or changing code is hard, but remembering to get all the various places changed can be a challenge. It seems that any refactoring might change an item in three or four places, but then forget one more, which leads to bugs and embarrassment.

    Fortunately, SQL Prompt has a few things to help. Smart Rename is one of these, which will let you know about all of the dependencies and places where code will change. This makes quick work of renames, which is something I’ve appreciate in other languages, but not T-SQL before this.

    Note that renaming objects is still disruptive and can break connected applications, so this still should be undertaken with care, and in synchronization with renaming the objects in application code.

    There are also the renaming of variables, which can be helpful when you realize that your short or obscure names aren’t helpful to others on your team.

    Perhaps my favorite refactoring feature is the Encapsulate as New Stored Procedure. I think more people should be using stored procedures, and while we might experiment and develop code as a batch or query, we want to move this to a stored procedure. This feature makes this simple for developers, and it’s one you should ensure they know how to use.

    There are other items in the treasure map, many of which are useful, but you’ll want to practice with them and decide which ones are most useful and helpful in your daily work.

    If you haven’t tried SQL Prompt, download an eval today and give it a go. I bet you will love it and ask for your own copy.

  • Interviewing Avatars

    Imagine that you go to interview a candidate over Skype or even a phone call and the first thing you see or hear is: “Hi, my name is Hank, and I am an avatar. I will answer all your questions about Nick factually and completely, as if you’re talking directly to Nick. Are you still looking to fill this position?”

    That’s a quote from a blog post about HR and hiring issues. In this post, the author talks about a new system that allows a job seeker to use an avatar as a way to quickly apply for thousands of jobs. While this might be nice for the applicant, would any of you want to interview an avatar? Maybe you would a few times, or maybe you’d even start to like this as a way to get some basic information about a candidate. Of course, if the candidate has loaded up all sorts of technical facts from Inside SQL Server or How Would You Move Mount Fuji, then maybe you’re less interested.

    One one hand this is scary. On the other it’s awesome. I’d love to be able to answer some questions and provide some data about my career and goals and let an avatar go through initial screens. I wouldn’t want this to be used anywhere past the initial interview, but certainly it would help me to present a little more of myself in an interactive format. It could be a nice brand, and how fun would it be to interact with Steve’s avatar?

    In some sense, we might move in this direction. After all, this just levels the playing field between candidates and employers. Plenty of recruiting and HR people use their own software or algorithms to make quick decisions about a large number of applicants. I certainly know that you need to stand out with your brand and ensure your resume and online profile attract attention and this could help with that.

    Think about this. Is there a way to better present the data and information about ourselves, using technology to respond and help ensure that the position is a good fit for each of us? Hiring managers might use this, why not us? Actually, they are using Alex and Mya. Would this be a better way for you to control and show off some of your work? Even have the avatar show how you solved problems or responded to different situations? While this seems silly or science fiction, I wouldn’t be surprised to see this type of avatar-avatar interaction being used early in the process to decide if both parties should move forward.

    Steve Jones

    The Voice of the DBA Podcast

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

  • Finding Tabs in SSMS–#SQLNewBlogger

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

    Someone posted this as a question and I thought it was worth noting. I use SQL Prompt for formatting, and never worry if there are tabs in code, but I know there are people without this amazing tool.

    I added some tabs to a script and want to replace them.

    2018-05-04 09_50_15-SQLQuery1.sql - (local)_SQL2016.sandbox (PLATO_Steve (60))_ - Microsoft SQL Serv

    I hit CTRL+H for the search and replace toolbar. The tab character is represented by a \t in a regular expression. I enter that, and then enter 4 spaces in the replace text box. I do need to click the “Use Regular Expressions” button, which is the one my arrow is on in the image below. It’s a little box with an asterisk in it

    2018-05-04 09_51_39-SQLQuery1.sql - (local)_SQL2016.sandbox (PLATO_Steve (60))_ - Microsoft SQL Serv

    When I do that, tabs are highlighted in SSMS.

    2018-05-04 09_53_32-SQLQuery1.sql - (local)_SQL2016.sandbox (PLATO_Steve (60))_ - Microsoft SQL Serv

    If I click “replace all”, I see 4 replacements, and if I check, the tabs are gone and spaces live.

    2018-05-04 09_51_48-SQLQuery1.sql - (local)_SQL2016.sandbox (PLATO_Steve (60))_ - Microsoft SQL Serv

    SQLNewBlogger

    This is a quick post, an example of what you can do to show you’re building better work habits and learning about your tools.

  • Power BI Desktop on the Mac

    Power Bi is one of the neatest tools that Microsoft has built for data professionals. It allows anyone to build fantastic interactive visualizations that can help tell a story and help someone make decisions. There have been some amazing demo visualizations from Microsoft customers. I’ve seen a predictive maintenance visualization for airplanes, one for diabetes trends and a fun basketball visual. There are also a fantastic set of custom visual controls, quite a few of which are described in Devin Knights blog series.

    If you don’t know anything about Power BI, there are lots of resources, including some amazing tips from the Guy in a Cube. Adam Saxton has an amazing channel and puts together some impressive videos with Patrick LeBlanc. They might be one of the best sources for learning to work with the tools. You might want to spend some time playing with Power BI as I can almost guarantee that you’ll build better reports with this tool than you would otherwise. You’ll impress your customers, clients, and boss with your design work.

    Plenty of people have Mac laptops, especially business people, and for quite some time they’ve had to deal with a lack of native tooling. Certainly there are lots of software ports, and no shortage of web software, but there are always places where a lack of a native solution is problematic. I don’t know that we’ll get lots of software ported to a new OS, but there is a better solution. Containerization can help smooth the way.

    A few years back I met the Kenji Obata, founder of Turbo.net. He was doing some interesting work with containers, and I was fascinated by their work. Since then, they’ve grown and refined their technology, and now they have Power BI for Mac available. As soon as I saw their walk-through video, I wanted to share the experience. It’s pretty amazing, and if I were still running OSX, I’d be looking to use some of the Microsoft tools I want on the native desktop.

    This isn’t really native, but the experience feels native. The use of containerization technology might be debatable for databases, but for client applications, it’s amazing. The way that Turbo.net packages up applications is incredible. I like Turbo, and if you need to use Microsoft client applications on a Mac, you might give them a try. It’s not free, but it’s way better than virtualization and has some really cool features as well. I’m sure lots of non-technical people, especially management, that might build reports would love the experience of running Power Bi Desktop on their Mac.

    They even have SSMS available as a turbo container for the Mac, if you’re interested.

    Steve Jones

    The Voice of the DBA Podcast

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