Viewing 15 posts - 4,381 through 4,395 (of 10,144 total)
None of the existing NC indexes are covering.
Create the new index. Change the order of the key columns if necessary.
Then monitor index usage, the cost of maintaining the...
July 15, 2013 at 5:23 am
GilaMonster (7/15/2013)
ChrisM@Work (7/15/2013)
Edit - removed RESULTNUMBER, it's the cluster key.Why? What if someone changes the clustered index?
It won't matter if OP creates the index I suggested. Since it's covering,...
July 15, 2013 at 5:03 am
If you find the time to create the index I suggested, I'd be interested in seeing the execution plan 😉
July 15, 2013 at 4:46 am
ananda.murugesan (7/15/2013)
July 15, 2013 at 3:41 am
ananda.murugesan (7/14/2013)
thanks for reply... I got the result 00:00:00 seconds after update stats in NC Clustred Index in RESULT Table..
Can you post the actual plan?
Joins in the WHERE clause are...
July 15, 2013 at 2:31 am
Drop the table variables altogether:
SELECT
a.MemberId,
a.SortOrder ,
a.Status ,
a.ReasonCD ,
a.Active,
r.Rid,
r.RType,
r.Sensitive,
r.Weight,
r.ROI,
r.Program,
r.Mgmt_Ranking,
r.Significant,
(select top 1 Name from library WITH (NoLock)
where rID = r.ruleid) as ruleName,
min(b.analysisasofdate) initiallyIdentified,
max(b.analysisasofdate) mostRecentlyIdentified,
a.category,
v_cnt.ResponseCategoryCount,...
July 12, 2013 at 8:30 am
mister.magoo (7/12/2013)
use temporary tables with good indexes
And use temporary tables with columns which match the joins in the query:
inner join @alerts a on a.ruleid = r.ruleid
and a.alertbatchid =...
July 12, 2013 at 8:11 am
Hi Kath, welcome to ssc!
-- unless you are checking for NULL,
-- referencing a column from an OUTER-joined table
-- will turn the join into an INNER join
-- Here's the...
July 12, 2013 at 6:18 am
kapil_kk (7/12/2013)
Thanks Chris :-),In past also you make me learn Tally table n many things, its my pleasure to learn new things from you always.. :-P:-D
You're welcome! I learn something...
July 12, 2013 at 4:16 am
kapil_kk (7/12/2013)
Will this query be work in this manner..
If a voucher is 'Active at Ho' or its status is 'Dispatched' it is correct...
July 12, 2013 at 3:51 am
Here are queries 3 and 4 condensed in the same way;
SELECT gv.VoucherBookletNo
FROM GV_Voucher v
INNER JOIN GV_VoucherStatus gvs
ON v.VoucherStatusId = gvs.VoucherStatusId
WHERE v.VoucherNo = @Lastvoucher
AND (
(gvs.VoucherStatus =...
July 12, 2013 at 3:41 am
You can replace the first two queries with one query:
SELECT gv.VoucherNo
FROM GV_Voucher As gv
INNER JOIN GV_VoucherStatus gvs
ON gv.VoucherStatusId = gvs.VoucherStatusId
AND gvs.VoucherStatus = 'Active at HO'
WHERE gv.VoucherNo...
July 12, 2013 at 3:32 am
Rearrange the first two queries like so:
IF EXISTS
(
SELECT gv.VoucherNo
FROM GV_Voucher As gv
INNER JOIN GV_VoucherStatus gvs
ON gv.VoucherStatusId = gvs.VoucherStatusId
AND gvs.VoucherStatus = 'Active at HO'
INNER JOIN GV_ReceivedOffice...
July 12, 2013 at 3:28 am
asifejaz (7/12/2013)
it decrement the first row successfully. when moving to second row instead of decrementing it to one it decrements it to two , then to...
July 12, 2013 at 1:38 am
DROP table tbl
CREATE TABLE tbl
(ID int identity, Voucherno varchar(10), numstatus varchar(10)
)
INSERT INTO tbl VALUES
('V0001','Active'),
('V0002','Active'),
('V0003','Active'),
('V0004','InActive'),
('V0005','Active')
DECLARE @firstno varchar(10) = 'V0001',
@scndno varchar(10)...
July 12, 2013 at 1:35 am
Viewing 15 posts - 4,381 through 4,395 (of 10,144 total)