Viewing 15 posts - 61 through 75 (of 1,360 total)
Thanks Phil. Interesting maybe. The real answer is don't use cursors 🙂
May 7, 2024 at 12:57 pm
One of these, and only one, can be selected by a user as the default row
Why not store the user's default in the users table?
April 30, 2024 at 6:45 pm
split the recipe into two parts in the CTE. Part 1 is all the ingredients, weights for everything except the starter UNION ALL (For each ingredient in the Starter,...
April 30, 2024 at 2:24 pm
A data model to store the recursive relationships and to resolve them with a common table expression could include tables: ingredients, recipes, recipe_inputs, recipe_input_ingredients, recipe_input_recipes. With recipe_input_recipes you could store...
April 29, 2024 at 10:02 pm
Out of curiosity, our 2017 box shows a CPU cap of 25% with 4 CPUs which leads me to believe that it's not able to use all 4 CPUs...
April 25, 2024 at 8:01 pm
Excellent query Jeff. Thank you, thank you! Multiplying by 'combo' within the TOP clause is very nice
April 9, 2024 at 1:24 am
Well maybe the allocation is unavoidable. I was hoping for pixie dust or a magic trick 🙂
April 8, 2024 at 4:35 pm
It's difficult to know much based on the explanation. The SQL code provided isn't valid SQL Server syntax (afaik) and appears to be embedded strings for which the parameters are...
March 29, 2024 at 4:28 pm
Introducing Copilot in Azure SQL Database (Private Preview)
Of course, of course ready or not here it comes. As others have noted AI is quite useful for ginning up boilerplate...
March 29, 2024 at 4:08 pm
To calculate the points using column values would require to concatenate the string. Afaik if there are bad values you could use TRY_CAST with the 'geography' data type
March 28, 2024 at 2:22 pm
This reminds a little of a similar topic from a few weeks ago
https://www.sqlservercentral.com/forums/topic/inconsistent-query-execution-times
March 11, 2024 at 3:59 pm
One way could be to add the date and hour to the GROUP BY
select t.tagid, cast(v.ss_dt as date) day_dt, datepart(hour, v.ss_dt) hr,
...
March 6, 2024 at 7:29 pm
For the denominator you could sum SIGN(ABS()) functions. The SIGN function returns -1, 0, or 1 depending on if the input is negative, zero, or positive. The ABS function returns...
March 5, 2024 at 10:02 pm
Looks like if I add this in my query logic I'm getting the datetime desired
DATEADD(s,t_stamp/1000,'1969-12-31 20:00:00')
2024-02-01 01:00:00.000 2024-02-01 01:00:01.000
Struggle with doing the count of records per TagID within the...
March 5, 2024 at 8:05 pm
CREATE TABLE [dbo].[tmp_sqlt_data_1_2022_05](
[tagid] [int] NOT NULL,
[intvalue] [bigint] NULL,
[floatvalue] [float] NULL,
[stringvalue] [nvarchar](255) NULL,
[datevalue] [datetime] NULL,
[dataintegrity] [int] NULL,
[t_stamp] [bigint] NOT NULL,
PRIMARY KEY CLUSTERED
(
[tagid] ASC,
[t_stamp] ASC
)WITH (PAD_INDEX =...
March 4, 2024 at 7:06 pm
Viewing 15 posts - 61 through 75 (of 1,360 total)