« first day (4849 days earlier)      last day (44 days later) » 

6:46 AM
I haven't bothered with SSMS 20 yet. Should I?
 
 
1 hour later…
8:01 AM
Oh, you're missing out. The dialog boxes are out of this world
 
Hmmm
morning
Strands #42
“Join the club!”
🔵🔵🔵🟡
🔵🔵🔵
Connections
Puzzle #308
🟩🟨🟨🟨
🟨🟨🟨🟨
🟩🟩🟩🟩
🟪🟪🟪🟪
🟦🟦🟦🟦
Wordle 1,030 4/6*

⬛🟨🟩⬛⬛
🟨⬛🟩⬛⬛
⬛⬛🟩🟩🟩
🟩🟩🟩🟩🟩
 
 
2 hours later…
10:16 AM
Wordle 1,030 5/6*

⬜⬜⬜⬜⬜
⬜⬜🟩⬜⬜
⬜⬜🟩⬜⬜
⬜⬜🟩⬜🟨
🟩🟩🟩🟩🟩
 
 
3 hours later…
1:15 PM
@Charlieface As a curiosity you might find interesting, concerning John's question:
SELECT
    SRV.ServerName,
    SVS.StatusName,
    INS.InstanceName,
    INSST.StatusName,
    DBS.DatabaseName,
    DBSST.StatusName
FROM dbo.[Database] AS DBS
JOIN dbo.[Status] AS DBSST
    ON DBSST.StatusID = DBS.DatabaseStatusID
RIGHT JOIN dbo.Instance AS INS
    ON INS.InstanceID = DBS.InstanceID
JOIN dbo.[Status] AS INSST
    ON INSST.StatusID = INS.InstanceStatusID
RIGHT JOIN dbo.[Server] AS SRV
    ON SRV.ServerID = INS.ServerID
JOIN dbo.[Status] AS SVS
    ON SVS.StatusID = SRV.ServerStatusID;
The interesting thing being that, by working bottom up and using RIGHT outer joins instead of LEFT joins, we can write the Status joins naturally and without 'nesting'.
A not unrelated point: joining to joined tables confuses SQLPrompt
That said, in this case where we're just looking up a status code, you might as well write subqueries in the SELECT clause. There are many possible query expressions, as usual.
 
1:38 PM
I finally got to use a full join
It was unremarkable
 
Did you have a crowd COALESCEing around you
Whenever I use a FULL JOIN, I always worry I just did something dumb and unnecessary
Was the execution plan also unremarkable
 
i probably have but DMVs were involved so i don't feel too bad
OUTER APPLY
(
    SELECT
        filegroup_name =
            fg.name,
        partition_scheme_name =
            ps.name,
        partition_function_name =
            pf.name
    FROM ' + QUOTENAME(@database_name) + N'.sys.filegroups AS fg
    FULL JOIN ' + QUOTENAME(@database_name) + N'.sys.partition_schemes AS ps
      ON ps.data_space_id = fg.data_space_id
    LEFT JOIN ' + QUOTENAME(@database_name) + N'.sys.partition_functions AS pf
      ON pf.function_id = ps.function_id
    WHERE x.data_space_id = fg.data_space_id
there is probably a better way to do that
the x alias is from sys.indexes in a larger query with some grouping
 
That is p ugly
 
sure is
but it works
 
ship it
 
1:48 PM
@PaulWhite I find right-joins if anything confusing and unnatural. Nested joins I use the whole time, to me they are perfectly natural, like parens in arithmetic (x + y) * z. As long as you indent them it should be clear what's going on.
 
Do you have a name for that indenting style that is sometimes 2 spaces and sometimes 4
 
Why does everyone have a different way of indenting SQL?
 
the only thing that i double indent is ON i think so it aligns with the end of the join/left/full
 
And Jetbrains Datagrip has one that nobody in ther right mind uses
 
so what's going on with that WHERE and OR then
@Charlieface That really wasn't my point, but to engage with you for a second, everything's confusing and unnatural until you choose to adopt it.
 
1:52 PM
@PaulWhite I hear. A few people have told me that nesting joins feels unnatural and they'd prefer subqueries, I just find them verbose.
Right-joins is an interesting idea, I suppose would just need to get used to it.
 
I think it's the adjacent ON clauses that really jar with some people
 
yeah that's a trip the first time you see it
 
Parentheses certainly help
SQLPrompt really gives up with them, which makes coding a chore
 
Weirdly it works with APPLY as well so you can do LEFT JOIN x CROSS APPLY (someCalculationFromX) y ON someConditionUsingY which can be pretty useful.
 
Anyway, I'm not really a RIGHT JOIN advocate, I just find them interesting sometimes. Occasionally, it is easier to use that syntax, but all is subjective (except tabs v spaces and commas at the end of the line).
@Charlieface I suppose some people enjoy long code review sessions
The demo code in John's question would take a while to go through code review
Probably, I'd just save time and shoot him in the face right there and then. Early lunch
 
1:59 PM
I wouldn't allow it through with the unnecessary [] quoting
 
No schema prefixes. Table definitions without NULL or NOT NULL. No constraints.
Reserved names. Ugh.
 
Look what power bi does to semi joins blog.crossjoin.co.uk/2024/04/14/…
 
I really don't like the singular for table names, or different column names for foreign keys
(deep breath before clicking the captain's link)
 
el capitan
 
Oh god
When will people stop with this crap
 
2:06 PM
he he he
 
I had a physical reaction to some of that generated SQL
 
is it me or will that null checking get weird without some parens
of course the optimizer might just throw it out with the semi join involved
 
I don't even care
I just want it to end
All these people are going on z-cores
What is this absolute obsession with writing programming code and JSON to auto-generate terrible SQL
I'd prefer endless nuclear winter
So, yeah, thanks for sharing
Is there a way to close a tab so it absolutely, positively, never opens again
 
@PaulWhite you might get your wish!
 
I'm not that lucky
 
2:17 PM
z-cores are the worst
 
well it's an election year here so expecto bullshittum
 
it does get turned up to 11 or 12 at such times
you're very lucky to get choose between two such stellar candidates
benefits of a large population pool, I guess
 
there's no sense in me voting for anything
i'd either be adding to an already extreme majority or minority in nyc
 
ah, the sweet smell of democracy
 
it's nice to pretend
 
2:23 PM
must be a hell of a responsibility to vote in places where it might actually make some difference
you don't need that extra stress
imagine if clown A got in instead of clown B, or worse, vice versa
 
2:47 PM
yeah it's hard to imagine what would happen if someone i didn't like got elected
my world would crumble
 
3:09 PM
BEGIN COMMIT END
kinda funny when you see it all on one line
 
 
3 hours later…
6:25 PM
@Zikato Do you care if I add to your answer for the resource governor? I don't think I can propose and edit I think it just edits it directly.
 
6:52 PM
Editing an answer
How polite
Real men add additional answers and dunk on other answers
Nuclear dunks
 
 
2 hours later…
8:45 PM
@SeanGallardy go for it. I wasn't taking the question seriously anyway
Apr 9, 2023 at 18:21, by Paul White
Reading comprehension being what it is these days
 

« first day (4849 days earlier)      last day (44 days later) »