Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Linked query problem
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01406767
Message ID:
01406776
Views:
23
>Thank you Naomi...this works. I am still trying to understand why the original statement stopped working...
>
>
>
>;with cte As (select distinct EDP from  [AMSWHSERVER3\AMS].slotting.dbo.productinfo)
>
>select CASE WHEN LTRIm(RTRIM(LEN(cUPCNo))) = 5 THEN '0'+ LTRIM(RTRIm(cUPCNo)) ELSE LTRIM(RTRIm(cUPCNo)) END as cUPCNo, 
>		cSKUId, iForecastQty, cEDPNo, cMacsDescript, 
>		cECometryVendorNo, cPVB, cProductTypeId, iWarehouseLocId, 
>		cProductFamilyId, nCaseQty,
>		CASE WHEN lBuyInCase = 1 THEN 'YES' ELSE 'NO' END as lBuyInCase
>	from [BIZTALK\PRODUCTION1].MerchNew.dbo.m_newItem N 
>                     LEFT JOIN CTE ON N.cEDPNo = cte.EDP
>	where lSlottingUpload = 1 and CTE.EDP IS NULL
>	And dSlottingUpload = '2009-06-17 13:35:15.000'
>
I can only speculate - I think the original may have used too much memory or something. In this way as it's now it's much easier to maintain and also the problem is separated to two pieces.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform