Viewing 7 posts - 1 through 8 (of 8 total)
I'm not sure how else to post it, so here is the plan in XML format.
<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.1.1" Build="10.0.5512.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
...
November 20, 2014 at 2:07 pm
I modified the query to select just the past two (2) weeks, and it sped up significantly. I welcome any other performance enhancement suggestions, but this may have solved the...
November 20, 2014 at 8:49 am
ScottPletcher (11/19/2014)
November 20, 2014 at 8:19 am
Your original code used datetime to determine the "last" row. Indeed, it went to the trouble of a separate subquery to insure that datetime was determinate instead of RCN.
You...
November 19, 2014 at 8:11 pm
ScottPletcher (11/19/2014)
November 19, 2014 at 2:18 pm
Here are the insert statements:
INSERT INTO dbo.UnitLog (RCN, UnitNumber, UnitStatus, fldDateTime, CCNo, CommCenter) VALUES
('1','373','10-41','2014-11-07 15:59:00.0000000','2014-000057','20'),
('2','373','10-17','2014-11-07 16:59:00.0000000','2014-000057','20'),
('3','373','10-23','2014-11-07 17:09:00.0000000','2014-000057','20'),
('4','373','LOG','2014-11-07 17:19:00.0000000','2014-000057','20'),
('5','374','10-8','2014-11-07 15:59:00.0000000','2014-000059','20'),
('6','374','10-17','2014-11-07 19:49:00.0000000','2014-000060','20'),
('7','374','10-23','2014-11-07 19:59:00.0000000','2014-000060','20'),
('8','374','10-17','2014-11-07 20:04:00.0000000','2014-000061','20'),
('9','374','10-7','2014-11-07 20:19:00.0000000','2014-000061','20'),
('10','371','10-8','2014-11-07 11:29:00.0000000','2014-000055','20'),
('11','371','10-42','2014-11-07 11:59:00.0000000','','20'),
('12','372','10-23','2014-11-07 12:59:00.0000000','2014-000056','20'),
('13','372','LOG','2014-11-07 13:59:00.0000000','2014-000056','20'),
('14','372','10-8','2014-11-07 15:59:00.0000000''2014-000056',,'20'),
('15','372','10-7','2014-11-07 15:59:00.0000000','','20')
GO
INSERT INTO...
November 19, 2014 at 1:55 pm
Thanks for the reply, and I apologize, I did not understand the use of the IfCode Shortcuts before. I will try to provide the information as best as I can....
November 19, 2014 at 12:21 pm
Viewing 7 posts - 1 through 8 (of 8 total)