select dv.versionid, ff.name, .dbo.ve_getshortpathfromcontentid(cc.contentid) location 
from contents cc
join vefn_getversionitems('') vv on vv.contentid = cc.contentid
join docversions dv on dv.versionid = vv.versionid
join folders ff on ff.folderid = dv.folderid
where type = 10005
