Cody Konior
banner
codykonior.bsky.social
Cody Konior
@codykonior.bsky.social
130 followers 300 following 200 posts
Expert at scaling SQL Server and PowerShell. Happily married with 4 cat children 😻
Posts Media Videos Starter Packs
It’s sad that Azure SQL Database resource locks are completely bypassed by a T-SQL DROP DATABASE.
Just saying because it’s yet another adult thing that seems super simple on the surface but has depths of craziness that normal people shouldn’t have to know about 💀
Side thing but I’m on the mailing list of a local arborist and he sent a long article a week ago about this.

How there’s all kinds of rules over who pays based on whether the tree is native, and power companies don’t follow their own rules, and he has to answer angry confused calls all the time.
It’s a bit of an old programmers joke but I do actually spend a lot of the day waiting for things to compile or deploy these days 😅
If a logging process goes crazy and starts spinning up sessions dumping into a table, you could disable the user temporarily waiting for the other side to die, or add an instead of insert trigger for a little while that just does a return 😛
TIL if you have an empty folder you want to keep in git (so you don’t need to test and recreate it in every script that touches it) the convention is to use an empty .gitkeep file in there.
These are procedures like utility procedures, Hallengren stuff, etc that isn’t part of your project but that does get put into each database usually by a seperate process.
The other cool thing I found was; have procedures outside your project but that you don’t want dropped? You can just extract them into a dacpac and reference it. Now it won’t drop them on deploy anymore.

And yeah you can “turn off all drops” but often that’s not what you want.
I had resorted to doing all users in a post-script in SSDT but it turns out you can add a publish flag that lets you create the users but not deploy the fake logins you define for them.

That stuff is important when you want to drop all users not defined in your project.
Specifically last week you could OPENJSON a JSON variable. Now you can’t.

There’s a limitation listed in the documentation that you can convert to NVARCHAR first. But this was working functionality that has been changed overnight.

That’s what you get for using Preview features I guess 🤷‍♂️
If you’re using the JSON data type in Azure SQL Database they pushed a change for GA which has broken it.

Good luck.
If you open SQL Prompt and the dropdown menu only has 3 items on it (about, check version, something else), it means it has lost its license information.

Don’t bother messing with the folders or reinstalling. Click the about and it’ll log you back in to authenticate 🤦‍♂️

Shame it doesn’t tell you!
Yeah but this year they’re making it even thinner!!! 😏 /s
Some are just born with that rizz #sqlcatfamily
Unfortunately though I have no avenue to support tickets in my current company.

Sucks to be me.
I think I found a weird optimiser error in Azure SQL Database.

You can do a SUBSTRING CHARINDEX CHARINDEX with valid values and it’ll barf with a length error even though it’s 100% valid.

If you add a WHERE clause with that CHARINDEX > 0 to act as a filter, it works even though it’s not NULL/0/-.
Small reminder that changing elastic pools on an azure sql database is fine but can kill any active connections so like maybe don’t do it when that’s important.
* doesn’t work reliably, sometimes it does work, which is why it’s an extra piece of shit and misleading