Viewing 15 posts - 5,161 through 5,175 (of 10,144 total)
It might be worth converting (a version of) the sproc into a multi-statement table-valued function. The performance won't change but it would give you the flexibility of "running" the code...
February 27, 2013 at 1:46 am
, x.FAC_ACTIVITY [FAC_ACTIVITY]
, x.NUMMAINTEMP [NUMMAINTEMP]
, LH.dtLeaseFrom [LHdtLeaseFrom]
, LH.dtLeaseTo [LHdtleaseto]
, crp.destimated [crpdestimated]
--, pps.HValue [ppsNSFFEE]
,pps.NSFFee
,pps.MTMFee
,pps.SecDepIntRate
, m.stext [memoStext]
FROM vw_DK_RMMISCDATA x
LEFT JOIN Property p
ON x.RM_ID...
February 27, 2013 at 1:28 am
Jeff Moden (2/26/2013)
dwain.c (2/26/2013)
February 27, 2013 at 1:14 am
Ah, I think you're looking at a pivot - does this help?
SELECT
p.HPROP,
p.STYPE,
p.SVALUE,
NSFFee = CASE WHEN p.STYPE = 'nsffee' THEN p.hvalue END,
MTMFee = CASE WHEN p.STYPE = 'MTMFee'...
February 26, 2013 at 9:21 am
-- APPLY can simplify calculations like this;
SELECT
p.HPROP,
p.STYPE,
p.SVALUE,
x.Newcolumn
FROM PROPOPTIONS P
CROSS APPLY (
SELECT Newcolumn = CASE
WHEN p.STYPE = 'nsffee' THEN 'NSFFee'
WHEN p.STYPE = 'MTMFee' THEN 'MTMFee'
WHEN p.STYPE...
February 26, 2013 at 8:15 am
It's an estimated plan - the actual plan for one of the queries would be much more informative. However, the following points spring to mind.
Statistics appear to be out of...
February 26, 2013 at 7:26 am
mister.magoo (2/26/2013)
ChrisM@Work (2/26/2013)
dwain.c (2/26/2013)
ChrisM@Work (2/26/2013)
peter-757102 (2/26/2013)
February 26, 2013 at 5:15 am
Bought mine from GM too, about fifty quid IIRC. What you actually get is four...
February 26, 2013 at 5:10 am
dwain.c (2/26/2013)
ChrisM@Work (2/26/2013)
peter-757102 (2/26/2013)
February 26, 2013 at 4:46 am
BriPan (2/26/2013)
Add alias name to query like C(or any else ) then try ...
That's what I...never mind.
February 26, 2013 at 3:55 am
peter-757102 (2/26/2013)
February 26, 2013 at 3:53 am
BriPan (2/26/2013)
but If performance is in concern then go for
select CandidateID, max(YourDateColumn)from YourTable
group by CandidateID
Sean's solution is almost certainly quicker than Kingston's ROW_NUMBER method; however, Kingston's solution is a...
February 26, 2013 at 3:48 am
VASUforSQL (2/25/2013)
I have a table called Products which has many columns.
It is a temporary table used for reporting purpose. The data will be processed to this table concurrently by...
February 26, 2013 at 3:42 am
Viewing 15 posts - 5,161 through 5,175 (of 10,144 total)