Tag: T-SQL Tuesday

  • T-SQL Tuesday #137–Notebook Uses

    It’s actually my month to host T-SQL Tuesday, and I came up with the notebook idea last year. Aaron Nelson (b | t) sent me a link to a talk he did at a Meetup. It contained some interesting things, showing how you can use notebooks. Worth a watch.

    For me, I don’t use notebooks a lot in my work. I had thought about using them to show clients and customers how to use our products, but I hadn’t moved far in that direction. I think too many customers are still using SSMS primarily, and haven’t moved to ADS.

    The one place I’ve found them interesting is with Python. When I am sometimes trying to work through an issue, I think it’s easier to run a cell of code and get some results to work through an issue. If I use the REPL, I lose things. In VS Code, which I prefer, I don’t like the split code/terminal. I find that slightly annoying. Notebooks make things easier.

    I was doing this recently, as I tried to work on the Advent of Code. I tried different parts of an algorithm in different cells, just to see what the results were. This helped me to work out some logic.

    2021-04-13 10_02_06-● Day5.ipynb - Data Analysis - Azure Data Studio

    That’s not a great algorithm, and I got better over time, but this was really a good way for me to think about the sections of the problem, putting each on in a separate area.

    It’s a little of “teaching myself” within the construct of a notebook. After all, that’s what a lot of data scientists are doing when they start to go through different code items in a notebook.  They can share the notebook with others, which helps to teach.

    For me, it’s teaching myself.

  • #TSQL2sday #137 Invite Using Notebooks Every Day

    tsqltuesdayIt’s time for the T-SQL Tuesday blog party, and I’m hosting this month. I don’t host too often, but since I had some schedule mix ups, I’ll handle this month. Read the invitation below and then write your post for next Tuesday, Apr 13.

    If you want to host a T-SQL Tuesday, let me know. You can ping me on Twitter.

    Jupyter Notebooks

    I first heard about Jupyter Notebooks years ago. At the time I was just getting started in Python and I thought these were a great way to share code online with others. However, the setup and administration was a pain, and I quickly gave up.

    When I saw Microsoft add notebooks to Azure, I got slightly excited again, but once again, it was a bit of a pain to work with these. Too much administrative overhead, in my opinion.

    That changed a bit with Azure Data Studio, which has seen notebooks get added, and become easier and more stable. If you haven’t tried notebooks, get ADS and give it a try today. I even wrote a short piece on using these.

    Your Invitation

    For this month’s T-SQL Tuesday, I want you to write about how you have used, or would like to use, a Jupyter notebook. This seemed to be exciting for many people at first, but I haven’t seen a lot of uptake from users in general. So I’m curious if you are using them.

    A few resources for you:

    There is even a way to run these from PowerShell.

    So let me know how you are using notebooks, or your plans for the future.

    Publish your post sometimes on 13 Apr, UTC time.

    The Rules

    Publish your post sometime on 13 Apr 2021, UTC time.

    Leave a comment or traceback on this post.

    Use the T-SQL Tuesday logo at the top of this post in your post and link that back to this invitation.

    Spread the word.

  • T-SQL Tuesday #136–The Datatype Blog

    tsqltuesdayIt’s that time of the month again, and this time it’s an interesting topic. The invitation is from Iceland, where Brent Ozar has relocated for the foreseeable future. I’m slightly jealous, and wish I could go visit. I enjoy winter, and the pictures he’s posted look amazing. Definitely a bucket list trip for me.

    However, this month, he’s asking about data types. Are there some you love or hate, and I’ve got a thought on this. In case you wonder, there is a list, broken into types. Apparently MS went into a “categorize everything” frenzy in the docs, which is OK, but I often don’t intuit the way they’ve broken things down. I wish they kept a long list on a page somewhere that was easy to find.

    Naming Confusion

    It has been deprecated, but the timestamp type is still around. It’s not in the list, but it is mentioned as a synonym for rowversion. This is a unique binary number in each database, which is often used to detect changes in a row. If you have two people editing a row, and a change updates a rowversion column, then each can detect if that value is different from the original one. Handy in terms of client side conflict resolution, which can prevent last-writer-wins scenarios for applications.

    I haven’t seen it used lately, but in the 90s and early 2000s, I often saw code that checked this before letting a user make an update in some data entry application. However, this was often a “timestamp” column, which was constantly confusing to me as a DBA or developer. I kept thinking I’d get some sort of datetime stamp in there, rather than a binary value.

    This shouldn’t be a problem in the future, as timestamp isn’t really doc’d, though timestamp can be found on Google searches. 

    The other reason I dislike this type is that we can’t change it to rowversion. An ALTER TABLE … ALTER COLUMN doesn’t work.

  • T-SQL Tuesday #135 – Awesome Tools

    tsql2sday150x150It’s blog party week for T-SQL Tuesday, and I think this is a good choice for a topic. The host this month is Mikey Bronowski, and his invitation is on tools. I work for a tools vendor, and I’ve used a lot of them in my life, so I want to share what I think in 2021. I’ll also say that Mikey has a good list in his invitation of what he uses. I especially like his use of PoSh things and Greenshot.

    I’ve going to tackle this in a couple ways as I really have two parts of my job here, so I’ll look at tech tools and then productivity tools.

    Technical Tools

    I work for Redgate Software, so I use the Redgate Toolbelt a lot, as well as some of the Deploy tools. Specifically for me, I use these every week:

    • SQL Prompt – can’t live without it, and struggle to write t-sql when this isn’t working.
    • SQL Source Control / SQL Change Automation – I use these regularly, and while I tend to prefer SQL Source Control for many tasks, I love migrations. Slowly, I am moving to Flyway for some things, as I think this is our future.
    • SQL Clone / SQL Provision – I copy and mask databases regularly. This makes creating test copies quick and easy.

    Outside of Redgate, I really like VS Code for lots of editing, whether C#, Python, or PowerShell. I’ve been trying to use Azure Data Studio more, but I just prefer VS Code. No real good reason here. I have Sublime Text as well, which I use for text/html/markdown, but I think I am slowly going to move to VS Code for more, and I might not install Sublime on my next machine.

    I still live in SSMS most of the time, rarely in VS, but sometimes. However, as I do more DevOps stuff, I also have a few other major tools that I use every day and continue to learn about:

    1. git – I do a lot of command line stuff, and continue to get better, even with the VSCode client. I used GitHub and AzDO for repos, but lots of basic git stuff is important for my work
    2. Azure DevOps – I used other tools, but my goto, and the one I used for SQLMemorial.org, is Azure DevOps
    3. Chocolatey – package manager and install tool for Windows. This let me set up a machine in an hour or so, as opposed to a day.
    4. Docker – I use containers more and more rather than installing software.

    I may use other items, like tsqlt, but these are the big tools that help me get code written.

    Productivity Tools

    More of my job is writing related. I essentially run a newspaper at SQLServerCentral, and I produce a lot of content. As a result, I have some tools that make that easier, and help me coordinate with others.

    Here’s a list with a few comments:

    1. Evernote – I subscribe and use this to keep random notes for editorials and work things. I drop notes in here from meetings. I also have various items for my personal life, like logging maintenance on vehicles, license plates, recipes for cooking, and more. Worth my $$$. There are other good note apps, but I’ve been living on Evernote for 6-7 years, so no one has made a good case for my to switch
    2. DropBox/OneDrive – I sync stuff between machines and my phone. I’ve used DropBox for years, but their changes on mobile, which don’t make files stored and available, have me considering a fulltime move to OneDrive. A sync tool is important. Pick any one, but use it.
    3. Password Safe – Everyone needs a password manager. I’ve had this one since its release in 2002. free, secure, works across platforms, I see no reason to change. Use something here.
    4. Greenshot – I’ve tried various screen capture tools, but this one is lightweight, stable, and easily installed.
    5. Live Writer – I use the open source project for blogging. A drive sync tools keeps drafts on all machines.
    6. Camtasia – While there are lots of ways to capture screen video, Camtasia just works for me. Not the best, but simple enough and stable enough for building presentations and other recordings of my screen. I can record something quickly, and then edit a video or animated gif in minutes.

    While I certainly use Office (Excel, Word, PowerPoint), those are less of my day than these tools. I usually outline and build some stuff in Evernote before it goes into PPT. I do a little spreadsheet work, and some Power BI, but I’m really productive with these tools.

    The last tool I lightly mention is Spotify. I love music, and I appreciate having it in the background sometimes. My wife prefers Pandora, but whatever helps get you in a good mood, use it.

    My advice, try a few things, learn how one works well, and get better at it.