Tag: Humor

  • Executing Notebooks in a Stored Procedure

    Jupyter Notebooks are a popular way of consolidating a number of code batches together and them executing them as separate batches or all together. These are essentially a document with notes and code, all of which are stored together. Databricks can run these, as can a number of other services. They are also integrated into various tools, like Azure Data Studio.

    Just like many other technologies, we’d like to execute these in a way that suits our environment. While running these in a tool like ADS works fine, we might want to schedule these and check the results later. You can run notebooks with PowerShell, but keeping around results and managing the data is hard. Since many of us use SQL Server or Azure SQL Database, wouldn’t it be great if we could find a way to have these run inside SQL Server and keep the results around?

    I was poking around inside a database and discovered that I could do this. Only with notebooks that have T-SQL code, but that’s usually what we’d want to do inside a SQL Server (or Azure SQL) database. I need to write a more detailed article on this, but there are a few basics that might help some of you understand how this works. Essentially, there is an undocumented extended stored procedure, xp_notebookparse, that will read the JSON internals of a notebook and allow you to extract out there T-SQL batches. The @execute = 1 parameter will cause each of these batches to be executed.

    For results, a new notebook is created and added to a local temp file, #nbresults, as a BLOB value. You can explore the structure of this, but essentially, part of your stored procedure should take all the data from this table and add it to a permanent table in your database. If you use a stored procedure to wrap the extended stored procedure call and an INSERT..SELECT call together then you’ll actually get nothing to happen because today is April first. It’s April Fools and this is a joke. Hopefully, you aren’t too disappointed.

    Steve Jones

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

  • Easy SSIS Package Compare

    I’ve been asking for a way to compare SSIS packages for a long time, and finally Redgate has released an early access version. Years ago we had an internal version, but the visual comparison format was a problem. Really, we couldn’t decide how to actually compare packages on screen in a way that makes sense for users.

    Well, this has been a part-time project for a few developers, and they’ve been trying out ideas for years. I saw something last year that looked good, and I’ve been hoping they’d move it forward. It finally got accepted as a Foundry project, which is our research arm.

    It got a little polish, and now you can get a view of two packages, with various annotations that tells you something is different between the various tasks. The inspiration is the Execution Plan compare, which is in SSMS now.

    view-the-execution-status-of-ssis-package-2

    If you want to try this out, you can’t. It’s a joke. While I do hope they build this, for now, there’s no project in the works.

  • Datetime3

    I was reading about how 2020 ruined time for an author at The Verge. I agree. I find that March feels like an eternity ago, but so much of the hours and days between then and now have blended into a blur from that I can’t easily discern individual elements. As I cleaned up my speaking CV for 2020, I find myself either unable to differentiate some events from others or feeling that others were years ago.

    Time perception is a funny thing, and as the article notes, we can perceive it in different ways, especially under stress or difficulties. I’ve seen some funny posts, like Pandemic Standard Time, the 211th of March, etc. In fact, this is day 286 of March for me. Mar 11 was the day that most things in my life shut down, though I could see that coming.

    It’s gotten to be so crazy that I want to define a new data type, datetime3, which starts on that date and when I perform a datediff(day, 0, getdate()), I just get the number of days since my personal pandemic started. Maybe this could be a somber Easter Egg in SQL Server, a setting, like two digit year cutoff, that we each can set to remind us of the date when the world changed for us, and a new one began.

    I do think that with medical technology leaping forward that we can find some semblance of our old world, where we get together and share knowledge, smiles, and laughs. However, I also think all of us, and our organizations, will be somewhat changed by the events of 2020.

    I hope that begins in 2021.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher or iTunes.
  • The Silliness of a Group

    Recently we had a quick online tutorial for Mural, a way of collaborating online with a group. It’s often used for design, but it can be used for brainstorming and more. There are templates for standups, business models, roadmaps, and more.

    Anyway, we had a designer showing a bunch of others how to do this. Some product developers, team leads, advocates, and more. During the session, as we were watching, we were in a live mural where we could add items. I added a post-it with “Steve’s Note” on it, just to get a feel. I also added a photo I’d taken. Before long, the group chimed in, especially when the host misidentified Phoebe the horse as a goat.

    2020-11-19 09_23_58-Online Collaboration with Mural • Redgate

    We had another part of the session dealing with voting and making choices. The demo was with ice cream, allowing each of us to vote on a set of choices. Next we went to a template where we could add our own choices and people had fun, including me.

    2020-11-19 09_36_18-Online Collaboration with Mural • Redgate

    All in all, I see Mural as an interesting tool that I could see different groups using this in a variety of ways to collaborate, with some sort of Zoom/audio call and then focusing on a virtual whiteboard, there’s a lot here.

    I actually think this could be a neat way of posing questions, taking votes or polls, and sharing information in a group that can’t get together in person.

    .