Agusto Xaverius P Sipahutar

Job:Making some bugs and patch
Moss/Wss,C#,Sql Server,WWF,K2.BlackPearl
Motto : Keep Study and study
See also: Other Geeks@INDC

News




MCP Logo
MCTS Logo

MCP ID# 3542391

My Curiculum Vitae


Agusto Xaverius P S's Facebook profile

Other Article

My Community

My Article/Share Knowledge

Others Moss/Wss Site

My Other Website/Blogs

My Share (Ebook,etc)

Get File Sizes of Document from Sharepoint Database

Saya menemukan script sql ini di internet untuk mengetahui size dokumen yang ada di dalam site kita.

 

select [filename],

sum(CAST((CAST(CAST(filesize as decimal(38,2))/1024 As

decimal(38,2))/1024) AS Decimal(38,2))) AS 'Size in MB'

from (

select dirname + '/' + leafname as [filename],

size as filesize,

siteid,

webid,

ExtensionForFile

from alldocs

union

select d.dirname + '/' + d.leafname as [filename],

v.size as filesize,

d.siteid,

d.webid,

ExtensionForFile

from alldocs d

inner join alldocversions v on d.siteid = v.siteid

and d.id = v.id

) as results

inner join webs s on s.siteid = results.siteid

and s.id = results.webid

where (filesize is not null

and filesize > 0)

and ExtensionForFile not like '%aspx%' -- Not Include Certian File Types

group by

[Filename]

order by 2 desc

Share this post: | | | |

Comments

Twitter Trackbacks for Get File Sizes of Document from Sharepoint Database - Agusto Xaverius P Sipahutar [netindonesia.net] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Get File Sizes of Document from Sharepoint Database - Agusto Xaverius P Sipahutar         [netindonesia.net]        on Topsy.com

# August 7, 2010 6:26 AM