Paul White - Oh dear... Black-balled! Hangs head sheepishly. Shame down the generations in the family. No choice now - bottle of port in the dining room, take out pater's old Webley and put an end to the wretched ignominy of it all! This is just the final straw, the one that broke the back of the dromedary. Looking over a recent comment where I was pointing the OP to the importance of first principles - but I realised with horror that I had written prinicipals.
OMFG - what do school headmasters have to do with databases? Worse still, I couldn't edit - my OCD went into overdrive as did my persecution complex - blamed everybody from the Brits (who, in all fairness, are normally at fault for everything) to the primary school that I attended... ah well, I'm just going outside - I may be gone for some time!
> nobody gave a fig about democracy and/or the Jews
Clearly
> Again, "cordial" != diplomatic! We still have diplomatic relations with Israel but they can hardly be described as "cordial". Anyway, how's the US doing supporting genocide in Gaza these days?
Both in one, not bad...
"democracy and/or the Jews" basically European history in a nutshell. Don't get me wrong, the British and Americans aren't much better.
My personal theory is that while technical, it is also relatively straightforward, and does not require any obscure knowledge to understand. Which makes it interesting for broader audience. Clickbait, if you will.
@Yano_of_Queenscastle The latest information is in meta.stackexchange.com/q/325060, including the "points formula" via a link
In short, being a decent Q & A that is well-received locally helps get it on to HNQ. Being "clickbait"--or (more kindly) having wide appeal--attracts votes to keep it on the HNQ, up to 72h.
There is competition with other sites on the network, so choosing a quieter time might help with that
The mod team here doesn't have a very high bar for removing posts from the HNQ if they begin to generate too much noise/work
Or if they don't advertise the site well
Generating more votes is a bit of a side effect of the intended advertising element, attracting new users to the site
I had acidentially written this code
SELECT COUNT(*) "Table0" WHERE "Column0" = ? LIMIT 1;
When I meant to write this code:
SELECT COUNT(*) FROM "Table0" WHERE "Column0" = ? LIMIT 1;
I was really surprised that the first line compiled without giving any kind of error. I have checked the syntax ...
> This adaptation by Eggers is seen as both a homage to the 1922 original by F. W. Murnau and an attempt to bring new life to the vampire mythos while maintaining its dark, eerie essence. However, opinions vary on whether it successfully innovates beyond its predecessors.
So are you fundamentally saying the only way to create a stored procedure on the secondary database while its synchronizing is to create the stored procedure on the primary database? Or alternatively suspend the synchronization? — Patterson6 hours ago
@ErikReasonableRatesDarling The good and bad part about making things easy is you either make it easy and give people no knobs and everything just works that one way (aka Apple) or you make things easy and give them a crap ton of knobs and configs and assume people will be knowledgeable on the subject before effing with said knobs and configs. Sadly, most things fall in that 2nd bucket.
@Zikato I'll be honest, I'm not a huge fan of his code quality. Yes it works, and it follows recommended practices for backups and handles a lot of cases. But it's procedural code written in a single giant T-SQL script, which is about as bad as writing it in PHP. It should have been written in either Powershell or C# or Python, and broken up into separate functions.
Have you seen SQL Backup Master? Great piece of software, free version covers most cases.
and Standard and Pro versions are perpetual licence and don't cost much.
@ErikReasonableRatesDarling I love how his graph for inflation has medical care services and hospital services separate. Most people would put those in one.
I mean, all power to them, but there's a lot to be said for an MIT script written in a language you already know and use every day to do much the same sorts of thing
I suppose you could decompile it (it's written in C#) and recompile it. But you pay for support.
Like I've said many times, DBAs need to learn real imperative languages if they want to do imperative stuff. T-SQL just doesn't cut it for those workloads.
c.f. Sommarskog's enormous series on error handling
But sure, if you genuinely need something special that only paid/third-party software can do nicely, go with that. People have been doing that sort of thing forever.
That's what I was saying. C# can't catch C# compile errors at runtime. SQL can't catch compile errors at runtime. The reasons are different, but still.
I do relate to @Charlieface regarding enormous SQL stored procedures. They disturb me, and my instinct would be to try and break them up somehow. But it makes sense to do it that way for a lot of reasons.
@JoshDarnell what I was trying to say was: if you are executing dynamic SQL, you can catch errors very easily in C#. But in SQL it becomes very difficult to cover all cases. You can't timeout a script, and you can't catch KILL or other aborts either.
It's a common theme in scripts to end up very long, admittedly very easy to do in Powershell as well, and even in C#. Just less likely with the way it's designed.
I think also the tooling for refactoring in SQL is awful, and breaking into functions and procedures often makes the code longer not shorter.
eg in many IDEs you can select a piece of code and click "Extract into Function" or "Introduce Variable", but SSMS doesn't have that. It's starting to get better in DataGrip though.
We also don't have nested schemas, which means you have to put prefixes on either the schema or table name.
A good thing about Ola's scripts is that they are nicely formatted and organized in general, and have some helpful code comments. By comparison, the last time I tried to look at sp_WhoIsActive I felt like I was losing my mind.
Yeah, that was all his work. He liked it at the time
One makes allowances for artistic expression
@Charlieface Going back to an earlier point. What particular example of a compile error did you have in mind? One that is uncatchable from T-SQL, I mean.
Actually, the worst bit about sp_WIA was trying to work out what DMV columns really mean
There was much frustration about start and end times, for example
@ErikReasonableRatesDarling The issues were more about when exactly start time or end time occurred for a task, statement, or batch. The documentation doesn't say, and it was not at all easy to work out in all circumstances.
I don't like the "Multi-column Conditions" section (too many times it's gonna trigger), but I would add banning SELECT @variable = col1 FROM someTable unless there is a uniqueness guarantee.