Viewing 15 posts - 16 through 30 (of 1,435 total)
If all of the self-joins are needed, some filtered indexes might also help.
As always .... TEST, TEST, TEST
CREATE NONCLUSTERED INDEX ix_Design_Parts_BOMitem
ON design (design, designAlternative, version, class, operation,...
November 8, 2024 at 10:33 am
I would try to push my predicates up as high as possible, then isolate my top-level values, before getting the rest of the data.
Something like this
;WITH cteVersion...
November 8, 2024 at 9:33 am
If you have multiple threads, the inserting of VALUES could result in duplicates.
I would modify this to use the WHERE NOT EXISTS
IF (@@RWOCOUNT = 0)
BEGIN
INSERT...
October 29, 2024 at 5:46 pm
Why not pass your values to a stored procedure.
Then in the stored procedure you can do a proper upsert pattern
-- Inherent in the WHERE clause is the...
October 29, 2024 at 5:00 pm
Adding to the above, this line in your WHERE clause is basically converting your LEFT JOINS to INNER JOINS
and t3.description = 'faulty device'
October 21, 2024 at 6:23 am
Just a thought - SQL 2005 still came bundled with SSMS built in.
So maybe RDP onto the box, and see if SSMS was installed.
October 16, 2024 at 12:22 pm
Question is a duplicate post
https://www.sqlservercentral.com/forums/topic/query-output-results#post-4453822
September 13, 2024 at 2:47 pm
A CROSS TAB query will work here. You just need to know how many sets there are
WITH cteGroup AS (
SELECT *
...
September 4, 2024 at 6:09 am
If you convert your UPDATE to a SELECT, you will see that you cannot filter the way that you are trying. The LAG works within your filtered results.
August 13, 2024 at 7:04 am
according to the rules of school mathematics, we bring to a common denominator
How to calculate the product of all of the denominators for each group? Why...
July 22, 2024 at 9:04 am
This took a bit of head scratching. I managed to solve it, assuming that there are a max of 3 parts per group (as per your example).
I then added a...
July 18, 2024 at 8:42 am
Create some sample data
DECLARE @SAMPLE_SIZE BIGINT = 1000;
DECLARE
@MinInt int = 10000
,...
July 12, 2024 at 6:23 am
This article from Brent Ozar might help
June 20, 2024 at 2:53 am
Viewing 15 posts - 16 through 30 (of 1,435 total)