Hello all.
I need your help. I am getting a slow response on the "Stuff" function, when its sorting outZip+4 codes, or I am not sure where... Can you please take a look what can be improved to search faster. I am using MS SQL2014.
SQL
SELECTStateCode.NameasStateName,Office.DescriptionasOfficeDescription,Region.DescriptionasRegionDescription,Region.RegionasRegion,Distance=isnull(convert(numeric(18,0),dbo.fn_GetDistanceBetweenPoints(izip.latitude,izip.longitude,Zip.Latitude,Zip.Longitude,'M')),0),'View Skills'asSkills,--empsk.SkillCode, -- Dima added 4/3/2019Incident.IncidentNumber,rtrim(Employee.EmployeeCode)asEmployeeCode,Employee.Name,Employee.Title,Employee.Address1,Employee.Address2,Employee.Address3,Employee.Address4,Employee.City,Employee.State,Employee.Zip,Employee.Country,Employee....