Viewing 15 posts - 1,021 through 1,035 (of 7,616 total)
SELECT C1
FROM #Base
WHERE C2 IN ('122', '123')
GROUP BY C1
HAVING SUM(CASE WHEN C2 = '123' THEN 1 ELSE 0 END) > SUM(CASE WHEN C2 = '122' THEN 1...
January 27, 2022 at 3:22 pm
Jeff,
You're right this is not ok. Just this morning I alse remembered myself, I have some scenes implemented, which are turning off particular lights even if the light are...
January 26, 2022 at 6:18 pm
It doesn't matter if the 'on' is followed by 'on' or 'off', just add up all the 'on' times.
It actually does matter because two on times without an...
January 26, 2022 at 6:13 pm
If Member_MRN_lkupAllMBRNOs is a multi-statement table-valued user-defined function, that alone is going to cause pretty massive performance heads. Either switch it to being an in-line function, or eliminate the...
January 26, 2022 at 6:07 pm
It doesn't matter if the 'on' is followed by 'on' or 'off', just add up all the 'on' times.
;WITH cte_switches_with_next_time AS (
SELECT friendlyName,...
January 25, 2022 at 9:44 pm
I provided the exact command to do that in my earlier code.
January 25, 2022 at 9:22 pm
That's a lot of images at one time. I suggest starting at 10K or even 5K and see how that goes first.
Btw, be sure to use sp_tableoption before UPDATEing the...
January 25, 2022 at 7:32 pm
I kinda wondered why the column data needed to have 'MB' in it when the column name said 'MB'?!
January 25, 2022 at 3:49 pm
STRING_AGG is not available in SQL Server 2016.
January 25, 2022 at 3:47 pm
SQL will separately use each one in order as the previous one gets full. That is, only one log file per db is ever used at one time. Unlike data...
January 25, 2022 at 2:55 pm
I'm not exactly sure what result you want, but if you want only a single result you need to add an ORDER BY to the query. A TOP (1) without...
January 25, 2022 at 2:46 pm
Using a sub-SELECT should help, even if the main "table" is actually a view.
SELECT job_op.seq, job_op.description, job_op.part, job_op.router, job_op.router_seq,
(SELECT /*TOP (1)*/ job_op_wc.workcenter...
January 24, 2022 at 10:17 pm
Just off the top of my head, here's on way:
DROP TABLE IF EXISTS #RELATIONSHIP_FLATTENED;
SELECT TOP (0) [CASE], INDIVIDUALID AS ID
INTO #RELATIONSHIP_FLATTENED
FROM RELATIONSHIP
--
CREATE UNIQUE CLUSTERED INDEX [RELATIONSHIP_FLATTENED__CL]
...
January 24, 2022 at 10:10 pm
Did you pre-allocate enough log space to handle the entire insert?
I had a load task that took 4+ hours. I noticed the initial log size was very small. After I...
January 24, 2022 at 9:53 pm
What "index maintenance" do you perform on the heap?!
I think a REBUILD should release unused space from a heap. REBUILD is just:
ALTER TABLE <your_table_name_here> REBUILD;
January 24, 2022 at 8:29 pm
Viewing 15 posts - 1,021 through 1,035 (of 7,616 total)