I am looking at a legacy system that stores XML blobs
A view is created over this so the data is more accessible (for reporting)
CREATE view [dbo].[Data]
as
select top 100 percent
data.value('(/Input/@FirstName)[1]','varchar(100)') as FirstName,
(select data.query('for $i in /Input/Control[@Name="Postcode"]/* order by $i/@UpdateDateTime descending return $i')).value('(/Value/@ValueCode)[1]','varchar(50)') as 'Postcode'
...
...
from data
Will SQL server generate statistics for queries run against this view?
top 100 percent
is absolutely useless - why is it there?