달력

06

« 2018/06 »

  •  
  •  
  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
2014.10.30 12:09

테이블별 용량 및 로우수 확인 Tech/MSSQL2014.10.30 12:09

테이블별 용량 


SELECT

  t_name = convert(varchar(50), min(o.name)), 

  T_sz = ltrim(str(sum(reserved) * 8192 / 1024 / 1024.,15,0) + 'MB') 

FROM

  sysindexes i inner join sysobjects o on (o.id = i.id) 

WHERE

  i.indid in (0, 1, 255) 

  AND o.xtype = 'U' 

GROUP BY i.id 

ORDER BY t_name asc



테이블별 로우수


SELECT 

  o.name, i.rows 

FROM 

  sysindexes i INNER JOIN sysobjects o ON i.id = o.id 

WHERE 

  i.indid < 2 

  AND o.xtype = 'U' 

ORDER BY o.name

Posted by 멋지다마라송


티스토리 툴바