Skip to main content

Posts

Showing posts from May, 2018

T SQL : Querying XML with Attributes takes so long to load with Resolution

-- This will take time to load up (almost FOREVER?) :( SELECT * FROM  (SELECT [TestId] = 999   -- Attribute(s): ,col.value('../@JeepNumber', 'varchar(10)') as JeepNumber ,col.value('../@AccountPeriod', 'varchar(10)') as AccountPeriod ,col.value('../@TotalNonConformityDeviation', 'decimal(18,2)') as TotalNonConformityDeviation ,col.value('../@TotalWorkhours', 'decimal(18,2)') as TotalWorkhours -- Normal column(s): ,col.value('data(PersonEmployeeId[1])', 'int') as PersonEmployeeId ,col.value('data(RankCode[1])', 'varchar(10)') as RankCode ,col.value('data(PeriodDate[1])', 'varchar(10)') as PeriodDate ,col.value('data(Comments[1])', 'varchar(max)') as Comments ,col.value('data(RestHourApplicableIn24hHourPeriod[1])', 'decimal(18,2)') as RestHourApplicableIn24hHourPeriod ,col.value(