Viewing 15 posts - 991 through 1,005 (of 10,144 total)
skmoh2 (1/10/2017)
Loop1 : Table1_Peggging read Sales Order Material(SKU) Per sales Order
Loop2: Read full table2 for above Material. (Based on our example data you will get 7 records)
...
January 10, 2017 at 6:43 am
Arjun Sivadasan (1/9/2017)
having sum(charge_amount) > 0
Edit: Your original query checks for sum(charge_qty) > 0. Do both...
January 10, 2017 at 1:59 am
douglas.t (1/9/2017)
@chrism-2@Work - Your query did run faster, however it is not unique and so it brings up 9,266 rows instead of the 2,570.
Multiple rows per day I guess:
WITH charges...
January 10, 2017 at 1:14 am
Luis Cazares (1/9/2017)
ChrisM@Work (1/9/2017)
Or build a cross-tab into an APPLY block:
I usually avoid APPLY with correlated suubqueries because it tends to run the query row by row. Obviously, this is...
January 9, 2017 at 9:58 am
Luis Cazares (1/9/2017)
mishrakanchan86 (1/9/2017)
I have a view which looks something like below.
Select
* from T1 with(NoLock)
Inner Hash Join T2 With (NoLck) on T1.PID = T2.PID
Inner...
January 9, 2017 at 9:04 am
The execution plan indicates that the subquery picking up the row with the max date is the most expensive operation.
If charge_date is unique within each partition of a_site_id/charge_code, then this...
January 9, 2017 at 2:37 am
LeeFAR (1/6/2017)
Chris, I did see that the table vars are causing the estimated rows...
January 6, 2017 at 9:33 am
LeeFAR (1/6/2017)
January 6, 2017 at 9:19 am
LeeFAR (1/5/2017)
Attached is the query plan. The main query that is the trouble is Query 3. As you...
January 6, 2017 at 1:51 am
douglas.t (1/5/2017)
January 6, 2017 at 1:26 am
halifaxdal (1/5/2017)
You got it, but can you elaborate this? wouldn't that mean potentially every query must do the rowcount reset?Thanks.
https://msdn.microsoft.com/en-us/library/ms188774.aspx
and
https://msdn.microsoft.com/en-us/library/ms190356.aspx
It only has to be reset once it's been set. I...
January 5, 2017 at 9:58 am
Run
SET ROWCOUNT 0
and try again.
January 5, 2017 at 9:45 am
Can you post, as a .sqlplan attachment, the actual (as opposed to estimated) execution plan for "SELECT query that joins to this table", please? Thanks.
January 5, 2017 at 9:37 am
You're reading the base tables quite a few times. You should be able to extract your result set on a single read of the two tables, from what I can...
January 4, 2017 at 4:20 am
Run the code of the three relevant CTE's separately to identify which one is responsible, then doublecheck the execution plan. The optimiser throws up false positives from time to time,...
January 4, 2017 at 2:06 am
Viewing 15 posts - 991 through 1,005 (of 10,144 total)