Friends, the MidnightDBAs have a plan for 2022. A capital-P Plan. And it involves writing and teaching a lot. The plan for January 2022 is a focus on SQL Server security. We’ve already collaborated and published one blog over at MinionWare.net: UNDERSTANDING SQL SERVER SECURITY: Secure xp_cmdshell with the Microsoft Master’s guide (in 4 not-so-easy […]
Category: sql server
NVARCHAR length shows up doubled
An experienced DBA I know didn’t realize this: if you look at sp_help or sys.columns for an NVARCHAR column, the max_length value will show up as double the allowable length. Let me explain. CHAR and VARCHAR length is normal Let’s say we have a “val” column in a table, and it’s of type VARCHAR(10). CREATE […]
SQL Server meta-development (with regular expressions and more)
Yesterday, I had about 30 existing queries (and some multi-query processes) that I needed to turn into individual stored procedures. I could, of course, go through the entire list of queries manually, crafting CREATE PROC statements and so on. But what’s the fun in that? As much as possible, I like to use scripts on […]