Viewing 15 posts - 136 through 150 (of 7,597 total)
No. If they're sleeping, and don't have any active tasks, they are not using up CPU. They are taking a small amount of memory.
July 16, 2024 at 5:35 pm
I've generally found MERGE to be less efficient than UPSERT. Others maybe not.
You could generate the necessary WHERE clauses and CASE clauses to conditionally UPDATE 200 columns.
July 11, 2024 at 10:09 pm
Because * SELECTs all columns, which would include hMy. Try this instead:
SELECT hMy, *
FROM dbo.WF_HEADER
WHERE 1=1
ORDER BY 1 --<<--
July 8, 2024 at 9:47 pm
For one thing, don't force only LOOP joins, YIKES!
To tell you anything else, would need much more details on the tables and parameters.
July 8, 2024 at 8:20 pm
The data seemed inconsistent / "impossible" to me. How can the left-most 50 bytes be '3006' when that doesn't appear in the original value at all??
July 3, 2024 at 9:46 pm
Don't do online, do offline. That should be ok if you have scheduled down time anyway.
Otherwise, hard to say without more details. As stated above, you may not really need...
July 2, 2024 at 1:45 pm
SELECT DISTINCT UPC, STARTDATE, [MASTERCHAINNAME], REPLENTYPE,
CASE WHEN [REPLENTYPE] IS NULL THEN 'Not in CKB'
WHEN [REPLENTYPE] = 'NONE' THEN 'Non Replenishable'
ELSE 'Replenishable' END AS 'Replentype'
FROM dbo.tablename t1
WHERE...
July 1, 2024 at 9:58 pm
Select TBL1.caseid, TBL1.anotherid, TBL2.locked
From atable1 AS TBL1
JOIN atable2 AS TBL2 ON atable2.caseid = atable1.caseid
where TBL1.date Between CAST('2021-03-19' as Date) and CAST('2023-03-30' as Date)
and not exists(select * from atable2 AS TBL2 ...
July 1, 2024 at 6:13 pm
You just need a NOT EXISTS in the original query, but can't be coded accurately without knowing which columns are in which table(s).
July 1, 2024 at 5:58 pm
That query can't run, because you didn't specify which "caseid" in the SELECT.
We have NO way to know which column(s) are in which tables. You need to alias EVERY column...
July 1, 2024 at 3:50 pm
Assuming that AVALUE is based on the ID value (that is, the same ID always has the same AVALUE), then you can leave AVALUE out of the GROUP BY. If...
June 28, 2024 at 5:50 pm
Or take advantage of SQL's inherent capabilities by using the sql_variant data type (yes, technically you don't need the second CAST):
SELECT DISTINCT
...
June 27, 2024 at 1:56 pm
The above general approach should work, there just may be a more efficient way that's not popping into my head right now.
June 21, 2024 at 8:44 pm
We could brute force it; I'll try to think of a better way when I get a chance:
;WITH cte_person AS (
SELECT *, ROW_NUMBER() OVER(PARTITION BY...
June 21, 2024 at 7:05 pm
Combining them wouldn't optimize it. For three different tables, SQL must still scan each table/covering index to provide the results.
June 19, 2024 at 7:34 pm
Viewing 15 posts - 136 through 150 (of 7,597 total)