The Heap™ – Consultancy ©®

General on- and off-site discussion for dba.stackexchange.com....
15:42
Celcius, though, so it feels nicer
Jul 2 16:44
I guess somewhat relatedly at Microsoft
May 22 15:43
@PeterVandivier That's not a Cajun thing, that's a more a New Orleans thing.
May 22 15:40
Did they do any interpolated strings? That's so nice when doing templates in Powershell/Javascript/C#
May 22 15:39
Not feeling it
May 22 15:29
Lol, I think that was his birthday. When he died, they didn't have him in a casket, he was propped up in a lifelike pose and there were 2 straight weeks of second lines.
May 22 15:25
Drummer Uncle Lionel Batiste would wear his watch on his hand because he said he liked to have time on his hands.
May 22 15:24
May 22 15:21
@ErikReasonableRatesDarling Did you have time on your hands?
May 19 19:53
The Holy Trinity: True, False, and NULL
May 19 19:02
Glad I just stayed on VSCode. Lol
May 13 19:17
Every time I was hitting tab or space I was getting stressed out.
May 13 19:17
I don't know if it was confused by the file extension being ps1 because this is a literal embedded in a Powershell script or what, but today it has been doing so many bad suggestions, I just got tired of it.
May 13 19:16
It added another WHERE clause, duplicating some of mine and then put in all those weird comparisons.
May 13 19:15
May 13 19:15
I just turned off Copilot in VSCode
May 8 18:32
Better than Malort
May 8 18:25
Pisco sours all round - he's also a Peruvian citizen.
May 8 16:53
@JohnK.N. Are those insults or compliments?
May 7 17:33
So yes, it is hell. But better than me going and figuring out how I can standardize logo usage on PowerBI and Tableau dashboards across multiple OEMs automatically in our build process when partners can't be relied on to keep a file at a URL reliably...
May 7 17:31
May 7 17:31
Once again, I am waiting on test suites on a product to complete and came here for amusement.
May 7 17:26
Yes
May 7 17:25
And even if every OEM is supposed to have this function, I try to make things as robust as possible in the face of unexpected shit because error messages in SSRS aren't the easiest to figure out.
May 7 17:22
The synonyms actually are newish. They came in because one of the OEMs wanted to rename databases after our product was installed - which meant going into views and this function and changing each one to point to the new database. With the synonyms, everything is in one place.
May 7 17:21
Or they are super powerful and you have to do them over and over in every dashboard and on each platform because nothing is the same between Tableau and PowerBI and some logic is impossible to push into the database if it's layered at aggregate level.
May 7 17:19
Lol, I was just thinking how this would change if we retired our SSRS reports in favor of porting them to PowerBI and Tableau and I don't think anything would be able to be changed, because those platforms are just as weak for getting things done.
May 7 16:34
And although we validate the URLs we create in our tests, we don't validate the ones OEMs might return because we don't have their code or anything.
May 7 16:33
I'm not 100% sure why our test databases for that OEM don't stub it out, but they didn't, so I was kind of hesitant to stub it out on this test run just to get all the tests to pass.
May 7 16:32
It's a URL they are supposed to provide based on the parameters we send so that people viewing the report can go to some other place in their system that we don't control.
May 7 16:30
No even probably an issue at clients anyway, since if they did see it and it didn't fix itself, you could just patch it up by putting a function they maybe should have in their own database anyway.
May 7 16:29
This probably points to the need for more test setups that cover that configuration variation... I think it's only used in 3 reports, but, so seems crazy to test 5000 things both ways when only those 3 need to be tested each way.
May 7 16:17
That's what I'm thinking, to make the synonym exist (even if invalid) and then check the base object exists before executing the synonym.
May 7 16:15
This function previously did not use a synonym a few versions ago.
May 7 16:14
Yeah, there aren't many tools in there
May 7 16:12
There are no significant changes in this release, but one of the test environments was rebuilt (the SQL Server 2019 one), and the behavior seems messed up only on one OEM target in that environment, but I think it could just be due to timing because of this execution plan thing going on.
May 7 16:12
@PeterVandivier It's a product that works with different OEM databases. The synonym is not currently being created if the function is not on the other side (I can change that if I want - you can create an invalid synonym).
May 7 16:02
I'll revisit after all the test suites are run. But what I had done with sp_recompile on the function and then call it with OPTION(RECOMPILE) and it fails every time, not just the first time.
May 7 15:59
Shit, now it's not doing it because I stubbed out the other database with a function.
May 7 15:58
Oh yes, when I do option recompile it fails every time
May 7 15:57
And I bet if I got in there and ran a query before SSRS ran its query, it would not fail because the plan was there.
May 7 15:57
Because the SSRS test suites don't seem to fail on 2012, 2016 or 2022.
May 7 15:56
It might also be only a SQL Server 2019 issue with the error
May 7 15:55
This is a scalar UDF (because it's used in a query in SSRS), so that's why it's not in a proc and not dynamic SQL.
May 7 15:53
    IF (OBJECT_ID (N'[dbo].[functionname]') IS NOT NULL)
    	BEGIN
            RETURN dbo.functionname(@params);
        END
RETURN NULL;
May 7 15:52
Is there a reliable way to make a function that checks if a synonym exists and then calls the synonym function in the other database through the synonym, but if the synonym does not exist, return NULL or call some other function? What I'm seeing is that the first call gives an error, but then subsequent calls don't - like it makes a plan and finds that the synonym in the IF doesn't exist, but then uses the plan and doesn't hit that branch on subsequent calls.
Apr 16 21:30
Also, I am waiting on a big computed column adjustment on a table in another system. The first one took 6 hours. I think that might not have been the best design.