zoukankan      html  css  js  c++  java
  • 几段查看数据库表占用硬盘空间的tsql

    create table tablesize (name varchar(50),rows int,reserved varchar(50),
      data varchar(50),index_size varchar(50),unused varchar(50))
    insert into tablesize (name,rows,reserved,
      data,index_size,unused) exec sp_msforeachTable @Command1="sp_spaceused '?'"
     
    update tablesize set data=replace(data,'KB','')
     
    select *,convert(int,data) as a from tablesize order by A desc 
     
    drop table tablesize
    
    
    DELETE FROM LocalCopyOf_vw_PoitemValues
    
    
    
    EXEC SP_SPACEUSED
    
    
    
    
    
    SELECT * FROM 
    [Master].[dbo].[SYSPROCESSES] WHERE [DBID] 
    IN 
    (
      SELECT 
       [DBID]
      FROM 
       [Master].[dbo].[SYSDATABASES] 
      WHERE 
       NAME='Ligentix4_1'
    )
  • 相关阅读:
    053587
    053586
    053585
    053584
    053583
    053582
    053581
    053580
    053579
    053578
  • 原文地址:https://www.cnblogs.com/matong/p/4402136.html
Copyright © 2011-2022 走看看