« first day (4857 days earlier)      last day (29 days later) » 

1:08 AM
Nazi human experimentation was a series of medical experiments on prisoners by Nazi Germany in its concentration camps mainly between 1942 and 1945. There were 15,754 documented victims, of various nationalities and age groups, although the true number is believed to be more extensive. Many survived, with only a quarter of documented victims killed. Survivors generally experienced severe permanent injuries. At Auschwitz and other camps, under the direction of Eduard Wirths, selected inmates were subjected to various experiments that were designed to help German military personnel in combat situations...
Also:
Aktion T4 (German, pronounced [akˈtsi̯oːn teː fiːɐ]) was a campaign of mass murder by involuntary euthanasia in Nazi Germany. The term was first used in post-war trials against doctors who had been involved in the killings. The name T4 is an abbreviation of Tiergartenstraße 4, a street address of the Chancellery department set up in early 1940, in the Berlin borough of Tiergarten, which recruited and paid personnel associated with Aktion T4. Certain German physicians were authorised to select patients "deemed incurably sick, after most critical medical examination" and then administer to them a...
They weren't "nice people" should we leave it at that?
 
1:33 AM
Humans, as a whole, are not nice people.
2
 
 
4 hours later…
5:20 AM
@Charlieface oh well sure, I’m familiar with most of the atrocities, I just want sure if there was something specific about their drug policy that was interesting
 
5:49 AM
morning
 
6:37 AM
morning
 
 
1 hour later…
7:49 AM
morning
Wordle 1,038 3/6*

⬜🟨🟨🟨⬜
🟨⬜🟨🟨⬜
🟩🟩🟩🟩🟩
 
 
3 hours later…
10:21 AM
Morning.
Recently, I've read on this guy's blog idea to put debug blocks in your SQL procedures. (IF @debug=1 SELECT this or that). I've been toying with it in my own procedures, but I often end up with like 30-40% of my procedure being such debug blocks. I find that ugly and to a large degree less readable.
Is that just because it's technique I am not used to, or and I doing something wrong?
(Question like this would likely get closed as opinion based on the main site, right?)
I asked the Copilot, and it advised me to put the debug logic into another procedure, lol.
 
11:01 AM
If I had a dedicated environment I would put it into a separate stored procedure. If I were making procedures for open source distribution I would rather not introduce object dependencies. I believe people who blog about these things have said something similar.
 
Wordle 1,038 4/6*

🟨⬛⬛⬛🟨
⬛⬛🟨🟨⬛
⬛⬛🟩🟩🟩
🟩🟩🟩🟩🟩
Jan 9 at 15:26, by John K. N.
	/* debugging configuration */
	declare @debug int

	/* debug settings
	1 = turn on debug information
	2 = turn off all possible outputs
	4 = turn on transaction handling

    [...]

	if @debug & 1 = 1  print 'Checking variables...'

    [...]

    if @debug & 2 <> 2
    	BEGIN
    		PRINT ''
    		PRINT 'Running with default parameters'
    		PRINT ''
    		PRINT '@ixxx ='  + convert(varchar(20), @ixxx_CONST) + ''
    		PRINT ''
    	END

    [...]

    if @debug & 4 = 4
    	BEGIN
    		begin tran john
 
@ErikDarling Like erikdarling.com/…?
Would a temporary procedure not work?
It would be nice if SSMS supported code regions natively, and/or remembered the expand/collapse state of outlines when opening a saved file
 
Sounds like you want ADS
 
Does it
I'll let that go because you're not a native speaker
 
@Yano_of_Queenscastle What is in the debug blocks? The data values? Like temp table and variable contents?
 
11:18 AM
@Zikato I meant something like this: dbfiddle.uk/pAvtvRPz
 
@PaulWhite could very well be.
 
Those bloggers get everywhere
 
@ErikDarling Separate procedure... like having one procedure twice, one version with debug prints and one without?
 
No of course not
A separate procedure to handle the repetitive debugging logic.
 
I see. Well, yes, that makes much more sense.
 
11:26 AM
@Yano_of_Queenscastle You could trace that externally to the Stored Procedure with Extended Events
 
I am ashamed to admit, that I've never used the Extended Events.
Wouldn't Extended Events be... bit overkill?
@JohnK.N. I love the granularity of this, but I am not sure how I feel about bitwise logic for debugging. It rarely deal with it, so it's bit foreign concept for me. Like, I know about it, but I have to actively thing about it. And for logging and debugging, I would prefer using dead simple stuff, that I could not fuck up.
 
11:43 AM
There’s a lot left to be desired with t-sql debugging. Of course sql not being meant to be a procedural language has probably kept many useful declarative additions at bay.
Just an an example, being able to grab all parameter values in an address space.
Otherwise capturing those generically means building a dynamic sql string of them
 
Not having a functional T-SQL debugger anymore is also a drawback
 
Be the debugger
 
One with the code
 
This is what I sing in my head when I write debugging code
 
nice
This plays in my head whenever I deal with ownership chaining
 
12:44 PM
Every time I have to write SQL:
Every time Erik pushes a commit to git:
 
1:05 PM
@PaulWhite This one is the most iconic for me
 
@Zikato Yes, me too, but it wasn't grim enough for the context
 
 
1 hour later…
2:22 PM
Our flight back is delayed
We may qualify for European citizenship
 
2:36 PM
Which country?
 
Whatever Amsterdam is in
 
2:51 PM
Ah, no idea then
 
there would be no way of knowing
 
Given the way NZ is treated on maps, it may not even exist on some
 
I don't consider places that are below sea level
 
Apparently it’s nether here nor there
 
You might as well fly from Atlantis
 
3:02 PM
Is that Macedonian territory
 
3:31 PM
Wordle 1,038 3/6*

🟨⬛⬛⬛🟨
⬛🟨🟨🟨⬛
🟩🟩🟩🟩🟩
 
Wordle 1,038 5/6

⬜⬜🟨🟨🟨
🟨🟨⬜🟩🟩
🟨🟩⬜🟩🟩
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
I'm bad at this thing
 
4:03 PM
I'm not sure about "bad", you got it done 🙂
 
@ErikDarling Another catering truck mishap?
 
@Zikato that's the kind of thing one only says from the safety of a remote connection
 
czeched { try { ADS.suggest(); } catch() {}; };
 
nice
Erik - my Wordle is definitely a frog
 
@PaulWhite not sure, but we’ve boarded now
@HannahVernon nice work
 
4:13 PM
One engine should be enough
 
Or nice workle probably
 
> welcome aboard, I'm your pilot
 
Choo choo buckaroo, we’re flying over you
 
4:22 PM
You can watch one AI train another AI in real time: dba.stackexchange.com/questions/338878/…
 
I sniggered even though I know I'm not supposed to
 
4:37 PM
The I in AI is generous
 
Ah yes, my middle name, Sean Generous Gallardy
 
@SeanGallardy That's hilarious.
 
@SeanGallardy that's what I always think when I see you
 
😂💘
 
 
1 hour later…
5:45 PM
Does the generosity include money? Asking for a friend
 
6:06 PM
If your friend wants to give me some I'll gladly let them because I'm so generous
 
 
2 hours later…
7:36 PM
the output of fn_dblog contains a column called "Flag Bits", does anyone know what the values mean? I imagine 2 means the VLF the LSN belongs to is in-use, but I'm not sure.
I'm guessing it might be this:
0 - VLF is inactive
1 - VLF is initialized but unused
2 - VLF is active.
FYI, that's from my blog, so you'd think I might know, but alas I've never dug into the fn_dblog output too much.
I'm specifically wondering how SQL Server knows a specific LSN hasn't been consumed by a replication or CDC agent
 
If it's from fn_dblog then it should be immutable, so I wouldn't think that it has any state associated with it in terms of run-time. I would assume it'd have to do with whatever that log record needs set for it, like marked for replication or something.
 
cheers
 
I have no idea what all flags there may be, Replication was the first that came to mind (and CDC) but I'm sure there's more. Maybe aborted flag or something.
 
I have a log reader client being used by our Data Analytics team to capture transactions via CDC that claims it has read all the CDC LSNs but SQL Server thinks otherwise. I'm probably just going to mark the transactions as replicated via sp_repltrans but it has my curiosity up a bit.
 
What do you mean SQL thinks otherwise?
 
7:49 PM
the log reuse wait description is REPLICATION, and the log continues to grow
 
Then that makes sense, sounds like a large transaction or sparse transaction
 
8:52 PM
I resemble that remark !
https://www.reddit.com/r/mapsWithoutNZ/
 
This sounds like fun:
Msg 18805, Level 16, State 1, Procedure sys.sp_replcmds, Line 1 [Batch Start Line 6]
The Log-Scan Process failed to construct a replicated command from log sequence number (LSN) {00095658:000b98f0:00cc}. Back up the publication database and contact Customer Support Services.
Msg 22859, Level 16, State 2, Procedure sys.sp_replcmds, Line 1 [Batch Start Line 6]
Log Scan process failed in processing log records. Refer to previous errors in the current session to identify the cause and correct any associated problems.
its not prod though so CSS won't be hearing from me any time soon.
 
Praphrase that "do a backup NOW to cover your arse and then hot-potato the problem over to Support with a hospital pass"
 
yeah pretty much
 
9:19 PM
@HannahVernon I'm not in CSS anymore so have at it
but I'd be interested to know what was in that log record
 
I'm not sure what was in the log record, but client app is Fivetran HVR, which uses CDC to preserve transactions in the log until it has a chance to capture them. Pretty sure it got confused during an AG failover.
HVR likes to look at fn_dblog to read the log, based on LSNs from sp_repltrans. It doesn't schema qualify when calling the function and stored procs, so I was able to shim some custom procs into the process and avoid needing to give them sysadmin membership by cryptographically signing the stored procs.
 
🍿🥤
 
anyway, it seems to be back to normal now, so crisis avoided. By crisis avoided, I mean I wrote a script to clean up transactions until the log_reuse_wait_description was no longer REPLICATION.
/*
    Uses sp_repltrans to obtain a list of transactions that haven't
    been replicated, and marks them as replicated in the transaction
    log until the log_reuse_wait_description column of sys.databases
    no longer shows the transaction log is waiting for REPLICATION

    2024-04-22  Hannah Vernon
*/
SET NOCOUNT, XACT_ABORT ON;
DECLARE @log_reuse_wait_desc nvarchar(60)
DECLARE @cur CURSOR;
DECLARE @rows int;
DECLARE @total_rows int;
DECLARE @command nvarchar(max);
DECLARE @msg nvarchar(2048);
I figure that's gotta be better than disabling CDC and re-enabling it.
if I had the wherewithal I'd probably add that script to my blog.
 
brave using repldone
 
lol
the docs for that aren't exactly clear
 
9:29 PM
like I said, brave
:D
 
yeah I feel like I'd not be so brave if it were prod :-)
 

« first day (4857 days earlier)      last day (29 days later) »