Viewing 15 posts - 2,821 through 2,835 (of 10,144 total)
If you can set up your sample dataset in a readily-consumable format, I'll see what I can do.
Readily-consumable means a script which will run and populate the sample table with...
October 27, 2014 at 10:05 am
Try again:
Like Jeff I set up a scaled-up dataset to test against but ran out of time over the weekend to post it up. After reading Jeff's post I've added...
October 27, 2014 at 8:51 am
There appears to be a severe problem with posting at present.
October 27, 2014 at 7:31 am
Like Jeff I set up a scaled-up dataset to test against but ran out of time over the weekend to post it up. After reading Jeff's post I've added the...
October 27, 2014 at 7:27 am
sqldriver (10/24/2014)
ChrisM@home (10/24/2014)
sqldriver (10/24/2014)
ChrisM@Work (10/24/2014)
-- Changes MERGE JOIN to NESTED LOOPS, loses sort required for ROW_NUMBER()
Would you mind explaining some more about this part?
Thanks
Sure. Have a good look at the...
October 27, 2014 at 7:01 am
You're welcome:
--------------------------------------------------------------------------------------
-- Items
--------------------------------------------------------------------------------------
IF OBJECT_ID ('tempdb..#Items') IS NOT NULL DROP TABLE #Items
SELECT DISTINCT
ipcm.KeyDepot,
KeyVendor,
ipcm.KeyItem,
StockingUnitofMeasure,
LeadTime,
LotSize,
ipcm.MinimumBalance,
ipcm.PurchasingBuyerCode
,CASE WHEN BuyerCodes.PrimaryCode IS NULL THEN 'No Buyer Code Linked' ELSE BuyerCodes.Description END AS...
October 24, 2014 at 7:58 am
So now you understand that if you were to include this date column in your result set, it would increase your output rowcount by quite a lot - which was...
October 24, 2014 at 7:48 am
Thanks.
Here's that same query reduced even more so it's much easier to understand:
--------------------------------------------------------------------------------------
-- PlannedRequirement (cut down even more)
--------------------------------------------------------------------------------------
SELECT
KeyDepot = fpo.KeyDepotPlannedOrder,
fpo.KeyItem,
MIN_keydate = MIN(fpo.KeyDatePlannedRelease),
MAX_keydate = MAX(fpo.KeyDatePlannedRelease)
FROM BI1_DW_Fact_FirmPlannedOrders...
October 24, 2014 at 7:39 am
Thanks. Can you check this one please? I'm interested in the row count compared with the original, and also the difference between the min and max dates. "The original" in...
October 24, 2014 at 7:14 am
frdrckmitchell7 (10/24/2014)
dbo.BI1_view_Dim_ItemMaster IM = keyitemBI1_DW_Dim_CalendarDefinition = keydate
Here's that query again as a reminder. I need to know which table the column "keyitem" comes from:
/*
dbo.BI1_view_Dim_ItemMaster IM = keyitem
BI1_DW_Dim_CalendarDefinition = keydate
*/
--------------------------------------------------------------------------------------
--...
October 24, 2014 at 7:00 am
Hi Ben
ben.brugman (10/23/2014)
Now I see I did muck up a bit, the temp table ##WW should have been ordered, see the code below. Probably lost that part...
October 24, 2014 at 6:51 am
Which table contains column "keyitem" as referenced in the original query?
October 24, 2014 at 6:42 am
Can you describe the result set you get from this query please? I'm interested in the row count compared with the PlannedRequirement query (they should be the same), and any...
October 24, 2014 at 6:20 am
Excellent! Now we can work with a much smaller query than the original. You want to see keydate in the output of the PlannedRequirement query, correct?
October 24, 2014 at 5:45 am
Excellent. Next step, can you test this modification of your query please?
--------------------------------------------------------------------------------------
-- Items
--------------------------------------------------------------------------------------
IF OBJECT_ID ('tempdb..#Items') IS NOT NULL DROP TABLE #Items
SELECT DISTINCT
ipcm.KeyDepot,
KeyVendor,
ipcm.KeyItem,
StockingUnitofMeasure,
LeadTime,
LotSize,
ipcm.MinimumBalance,
ipcm.PurchasingBuyerCode
,CASE WHEN BuyerCodes.PrimaryCode IS...
October 24, 2014 at 5:21 am
Viewing 15 posts - 2,821 through 2,835 (of 10,144 total)