It's just Emanuele showing you what you can do in the Microsoft Data Platform

CategoryTips&Tricks

There’s a Bug with Extended Events creation in SQL Server Management Studio 18.7: what it is and a workaround

T

UPDATE: The bug still isn’t fixed in SSMS 18.7.1 Oh boy, what I found; I haven’t seen anybody else reporting on it, yet, so here I am.Fortunately, the bug is not breaking, as I’ve found a workaround, but still. Repro Open the “New Session…” GUI for extended events in SSMSGive it a name, it’s not importantAdd an event with a Duration Field, I’ve...

How to ship SQL Jupyter Notebooks and Books directly to Azure Data Studio by creating an extension in the Marketplace

H

The recently released Extension Generator for Azure Data Studio has opened up yet another way to ship Notebooks and Books to ADS allowing you to easily author your extensions. In my previous post I’ve detailed how you can now access a Book remotely, now, if you want the book to be actually installed in your ADS instance, you can install it as an extension! Follow this link for the SQL...

You can now script your database objects as a Notebook using SQL Server Management Studio 18.5+

Y

Great News Everyone! Microsoft just dropped SSMS 18.5 after almost 5 long months without any updates; this new release fixes a lot of bugs and introduces a few new features, above them all I’m now showing you the following. I’m sure that you used the the “Generate Scripts” feature in SSMS quite a few times, you could generate the code for schema and/or data for any (or...

How to update a SQL Server container on Docker for Windows (spoiler – there is a catch)

H

With the 1st CU for SQL 2019 released just yesterday, and Microsoft updating the docker image right away, the only natural response for me was to update the docker instance that I showed you how to deploy a few months back. The theory In theory, a docker container can’t be really “updated”, they’re meant to be stateless machines that you spin up and down responding to...

Why RDP'ing into a SQL machine is a bad idea

W

Guys, you should stop doing this, there are reasons if it’s not recommended to log into the SQL Server Machine via RDP as opposed to using a client on your PC (or another machine). PS: These recommendations are valid for any DMBS, not only SQL Server You’re stealing resources from SQL Server Probably you’re logging into your server because there is a problem, do you really want...

Get faster performance and lower network usage in SQL Server Loops by avoiding the “DONE Token” overload

G

FYI: You can get the Notebook for this article on my github and experiment yourself (opens with Azure Data Studio). Preamble Everybody knows that using loops in SQL Server is not efficient, if you’re able to write that same logic in a set-based statement it’s guaranteed to be faster.Still, devs can’t be helped, you just can’t seem to nail down the set-equivalent statement...

How to identify the unit of measure of Extended Events durations

H

Even if I use Extended Events almost every day, I always forget the unit of measure of each duration counter, since they’re basically arbitrary; Seconds, milliseconds, microseconds? Whatever, it depends on the dev that implemented that specific counter. That’s why I’ve added to Tsql.tech Github repository the following code that extracts the descriptions from XE DMVs in order to...

Quickly move data between instances for testing using only PowerShell

Q

Quick tip, how many times did a dev ask you to move the PROD/QA data to DEV to test a feature? Of course, not the whole DB, which would be too easy via a scripted backup/restore, but only a single table, or subset of table data? How do you deal with it usually? With the SSMS Import data Wizard? (ugh..) Exporting to flat file and reimporting? Linked Servers? External tools? Restore the whole...

Cast any string directly to XML with auto-escaping characters in SQL Server

C

Recently I had to look up the definition for a bunch of SQL objects and didn’t want to manually retrieve them manually in SSMS (with Create Scripts) or Visual Studio (by searching the object name in my TFS repository). Since lazyness and automation are the basis of a well done engineering work, I wanted to create a list, where I could basically click on the object that I needed and see the...

How to Show Better Execution Plans in Azure Data Studio

H

Azure Data Studio is starting to mature and some neat features are coming to the vscode-based (and now multidatabase and multiplatform) tool. We got query plans in the app since some time, but to be frank they’re not very pretty and have some issues with dark themes: Phantom Lines in plans with Dark Theme The new way Phil Scott built the Queryplan.show extension for Azure Data Studio, which...

It's just Emanuele showing you what you can do in the Microsoft Data Platform

Emanuele Meazzo

My Social Profiles

If you're interested in following me around in the social world, here are some URLs for you