Viewing 15 posts - 6,091 through 6,105 (of 59,089 total)
I really hope this isn't a dumb question. Is there a reason other then style or preference as to why you'd do this:
IF @Var1...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2020 at 2:22 pm
Phil, I don't understand why you think you need the self-join in your code.
It's simple, really: I never seem able to remember that you can update a CTE directly!
😀
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2020 at 4:46 am
I think the default should be that you're automatically "opted out" unless you decide to "opt in". Of course, that won't be profitable for these vendors and so that will...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2020 at 4:37 am
true, format() is slower, and I started using it since it was not available until SQL server 2012 and my employer migrated from SQL 2008 to SQL 2016. Just...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2020 at 4:23 am
Phil, I don't understand why you think you need the self-join in your code. It can still be done in a single scan of the table.
...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 7:20 pm
I'm afraid that ROW_NUMBER() isn't going to hack it for this problem, Phil. Here's what the output of your code is...
EDIT: My...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 7:15 pm
Hi
I have a table as below, with example data in it
ID Name 2346 M Smith 2346 M Smith 2346 ...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 6:30 pm
Network? Busy-ness of the machine it's on?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 5:57 pm
I'm not good with time management. No matter what I am doing I feel I should be doing something else. This means that I am easily distracted. The...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 5:02 pm
I really hope this isn't a dumb question. Is there a reason other then style or preference as to why you'd do this:
IF @Var1 = @VarA...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 4:46 pm
My goal was to demonstrate you don't need two cross apply.
SELECT SUBSTRING(CONVERT(CHAR(9), DATEADD(MONTH, DATEDIFF(MONTH, 0, t.thedate), 0),...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 4:30 pm
I'm not good with time management. No matter what I am doing I feel I should be doing something else.
This will sound strange but I'm actually really happy to...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 1:36 pm
I'm actually quite a bit surprised at you using an incremental recursive CTE for this, Peter. Your code runs in < 1ms like the other two do but your code...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 1:18 pm
Using Steve's good test data, here's a slightly different method, which also provides the MMM DD format requested in the original post. It's also the very first time that I...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 7:50 am
Just my 2 cents...
SELECT parent.*
,NewCol = CASE WHEN oa.Cnt > 0 THEN 'Mixed' ELSE 'Real' END
...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2020 at 6:22 am
Viewing 15 posts - 6,091 through 6,105 (of 59,089 total)