I'm working on a sharepoint project.it needs use SQL query to get some information about site collection and web.I'm using sharepoint 2010:
SELECT
Webs.Title AS [Site Title]
, Webs.FullUrl AS [Site Url]
, Lists.tp_Title AS [List/Library Title]
, COUNT(*) AS [Total GIF]
, CAST( CAST(SUM(Docs.Size) AS FLOAT) / 1024.0 AS DECIMAL(10,3) ) AS [Size (KB)]
FROM Docs
INNER JOIN Webs On Docs.WebId = Webs.Id
INNER JOIN Sites ON Webs.SiteId = Sites.Id
INNER JOIN Lists ON Docs.ListId = Lists.tp_ID
WHERE Docs.Type <> 1
AND Docs.LeafName LIKE '%.gif'
AND Docs.LeafName NOT LIKE 'template%'
GROUP BY
Webs.FullUrl
, Webs.Title
, Lists.tp_Title
ORDER BY
[Site Url]
, [List/Library Title]
, [Total Gif]
, [Size (KB)]
when I check the content database directly, I found that Sites.FullUrl is always null, although I do have multiple site collections and webs (webs.FullUrl is not null).
I checked 2 Sharepoint 2010 I installed on VM, they are both null for Sites.FullUrl. Can someone confirm that Sites.FullUrl should not be blank? Is it because of sharepoint 2010?
Using powershell, I can get all info I want. So, I guess I should be able to get all the info from database directly too. Is this correct?