Viewing 15 posts - 1 through 15 (of 2,165 total)
I just realized that both Jonathans and Jeffs queries used all 8 cores and mine just used 1 core.
So here is the same query with parallell plan
SELECT...
July 14, 2023 at 3:45 pm
The timings on my laptop
-- Jonathan
Table 'PATIENTS'. Scan count 18, logical reads 3494, physical reads 0, page server reads 0, read-ahead reads 1754.
Table 'Worktable'. Scan count 0,...
July 14, 2023 at 3:20 pm
SELECT FIRST_NAME,
LAST_NAME,
...
July 14, 2023 at 3:17 pm
Is it something this you want to achieve?
WITH cte_mockup_calendar(the_date)
AS (
SELECT DATEADD(DAY, value, '20230101')
...
July 3, 2023 at 7:53 am
Here is a "one query" solution 🙂
Finished in about 10 seconds for prime numbers up to 1 million.
DECLARE @max_prime INT = 1000000;
-- swePeso
SELECT value
FROM ...
June 15, 2023 at 3:36 pm
A simplified version is found here
https://www.sqltopia.com/mathematics/prime-number-generation/
June 15, 2023 at 6:38 am
June 15, 2023 at 6:38 am
The function returns the correct date between year 1900 and 2203.
May 24, 2023 at 6:17 pm
Probably something with
If exists(select * from inserted)
March 17, 2023 at 6:10 am
Keep it simple
DECLARE @sample TABLE
(
...
March 15, 2023 at 9:26 pm
Are you sure? I am summing at the lowest level, converting hours to minutes.
Then I am reverting the sum back to hours and minutes (for the sample data 29 hours...
March 2, 2023 at 7:10 pm
DECLARE @sum INT;
SELECT @sum = 60 * SUM(CAST(PARSENAME(REPLACE(x, ':', '.'), 2) AS INT)) + SUM(CAST(PARSENAME(REPLACE(x, ':', '.'), 1) AS INT))
FROM (
...
March 2, 2023 at 6:32 pm
IF DATEPART(DAY, SYSDATETIME()) = 1 AND DATEDIFF(DAY, '19000101', SYSDATETIME()) % 7 = 6
BEGIN
EXEC dbo.WhatEver;
END;
January 5, 2023 at 10:24 pm
Viewing 15 posts - 1 through 15 (of 2,165 total)