Viewing 15 posts - 1 through 15 (of 2,451 total)
Another problem I’ve seen frequently is the overuse of user-defined functions (UDFs), especially nesting scalar UDFs.
scalar UDFs, nested or not, tend to burn the house down. When used in a...
January 17, 2022 at 2:57 pm
Glen - I love this article. Amazing stuff. I read some of it and skimmed the rest but can't wait until I have time to play with your code a...
September 7, 2021 at 3:29 pm
Thanks for the replies and sorry for being a Ghost OP.
To me, the above makes sense based on the wording of those metrics and is useful information. Does the above...
July 7, 2021 at 9:29 pm
Adi did it like I would. His excellent solution could be simplified as
SELECT t.FamilyID, t.PortionKey, t.GroupID, GeneratorNumber = ...
June 9, 2021 at 12:13 am
I would write it using EXISTS instead of INs. It's easier if you use table aliases.
I always use EXISTS instead of IN. Best case - it performs better, worse case...
June 8, 2021 at 11:50 pm
Note that the "./" in your code is not required based on the XML Context. Also note that specifying that you need the elements' text, via text(), will improve performance.
May 4, 2021 at 3:29 pm
To better understand the problem and solution have a look at Well Formed XML:
April 23, 2021 at 5:03 pm
This is my first time messing with JSON in SQL. The BOL entry on this helped me.
First, JSON is cases sensitive so, $.Data is not the same as $.data. Next,...
April 15, 2021 at 1:49 pm
As Jeff mentioned, CONVERT + 101 gets you the formatting you need:
SELECT CONVERT(VARCHAR(10), GETDATE(), 101);
For the last day of the previous month:
April 14, 2021 at 10:04 pm
You can create your own INSTR function leveraging ngrams8k.
CREATE OR ALTER FUNCTION dbo.Instr8K( @string VARCHAR(8000), @search VARCHAR(100), @instance INT)/*Created by...
April 6, 2021 at 4:43 pm
For cleaner code you can leverage fnTally. Since fnTally leverages TOP, you can exploit row goals as Steve Collins mentioned above.
CREATE OR ALTER FUNCTION dbo.getYears(@year...
February 18, 2021 at 6:40 pm
I don't have a server handy at the moment but what you are looking for is in the REPORTSERVER.DBO.CATALOG
This has the RDL XML (Report Definitions) which you can query. To...
January 22, 2021 at 3:36 pm
@ Alan,I'm honestly a little bit surprised that you're justifying a sort because it has a low row count. We know how that usually works out.
I'm honestly a little bit surprised that you're justifying a sort because it has a low row count. We know how that usually works out.
I was a little rushed...
December 27, 2020 at 8:17 pm
apart from the performance that is likely to be quite bad has errors on its construct
The Construct is a problem but I suspect the performance should be fine, STRING_SPLIT is...
December 26, 2020 at 1:21 am
there is currently no way to incrementally populate the table.... a [Huge] fact table that gets regenerated nightly
there is currently no way to incrementally populate the table.
... a [Huge] fact table that gets regenerated nightly
This is a design/process issue more than a technical one. I'll put my...
December 8, 2020 at 6:28 pm