Skip to content

Instantly share code, notes, and snippets.

View mdawood1991's full-sized avatar

Dawood Awan mdawood1991

View GitHub Profile
<?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.2" Build="11.0.2100.60" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="40" StatementEstRows="1" StatementId="5" StatementOptmLevel="FULL" StatementSubTreeCost="20.4266" StatementText="SELECT &#xD;&#xA; JourneyStartId&#xD;&#xA; , JourneyEndId&#xD;&#xA; , AssetId&#xD;&#xA; , [Event]&#xD;&#xA; , JourneyStart&#xD;&#xA; , JourneyEnd&#xD;&#xA; , GeofenceId&#xD;&#xA; , JourneyDistance = ROUND((SUM(DistanceCoveredK) / 1000), 3, 1)&#xD;&#xA; , JourneyTime&#xD;&#xA; FROM (&#xD;&#xA; SELECT &#xD;&#xA; JourneyStartId = ignOn.iVehicleMonitoringId&#xD;&#xA; ,JourneyEndId = ignOff.iVehicleMonitoringId&#xD;&#xA; ,AssetId = ignOn.iAssetId&#xD;&#xA; ,JourneyStart = DATEADD(hour, @fGmtOffSet, ignOn.dtUTCDateTime) &#xD;&#x
@mdawood1991
mdawood1991 / WithoutMapURL.xml
Created March 25, 2016 10:21
Without Map URL
<?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.2" Build="11.0.2100.60" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="43" StatementEstRows="158416" StatementId="9" StatementOptmLevel="FULL" StatementSubTreeCost="30.4422" StatementText="Select&#xD;&#xA; OverspeedReportId = ol.iVehicleMonitoringId,&#xD;&#xA; AssetId = iAssetId,&#xD;&#xA; Registration = sReference,&#xD;&#xA; CategoryId = iCategoryId,&#xD;&#xA; CategoryName = sCategoryName,&#xD;&#xA; SiteId = iSiteId,&#xD;&#xA; SiteName = sSiteName,&#xD;&#xA; OverspeedDate = FORMAT(dtutcDateTime, 'dd-MMM-yyyy HH:mm:ss'),&#xD;&#xA; DistanceTraveledSinceLastOverSpeed = DistanceCoveredKM,&#xD;&#xA; TimeDifferenceDDDHHMMSS = SUBSTRING(dbo.xPT_ConvertTimeToDDHHMMSS(DiffSeconds,'s'),1,12),&#xD;&#xA; SpeedKM = fSpeed,&#xD;&#xA; [Address] = sS
@mdawood1991
mdawood1991 / With Map URL.xml
Created March 25, 2016 10:19
ExecutionPlan With Map URl
<?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.2" Build="11.0.2100.60" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="43" StatementEstRows="154399" StatementId="9" StatementOptmLevel="FULL" StatementSubTreeCost="30.421" StatementText="Select&#xD;&#xA; OverspeedReportId = ol.iVehicleMonitoringId,&#xD;&#xA; AssetId = iAssetId,&#xD;&#xA; Registration = sReference,&#xD;&#xA; CategoryId = iCategoryId,&#xD;&#xA; CategoryName = sCategoryName,&#xD;&#xA; SiteId = iSiteId,&#xD;&#xA; SiteName = sSiteName,&#xD;&#xA; OverspeedDate = FORMAT(dtutcDateTime, 'dd-MMM-yyyy HH:mm:ss'),&#xD;&#xA; DistanceTraveledSinceLastOverSpeed = DistanceCoveredKM,&#xD;&#xA; TimeDifferenceDDDHHMMSS = SUBSTRING(dbo.xPT_ConvertTimeToDDHHMMSS(DiffSeconds,'s'),1,12),&#xD;&#xA; SpeedKM = fSpeed,&#xD;&#xA; [Address] = sSt