Home > Database > Mysql Tutorial > Sql语句积累

Sql语句积累

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:43:54
Original
1218 people have browsed it

最近在给一家客户做系统维护时,需要查看数据库表的大小,相关的sql如下: 1. exec sp_spaceused '表名' --(SQL统计数据,大量事务操作后可能不准) 2. exec sp_spaceused '表名', true --(准确的表空间大小,但可能会花些统计时间) 3. exec sp_spaceused

最近在给一家客户做系统维护时,需要查看数据库表的大小,相关的sql如下:

1. exec sp_spaceused '表名'          --(SQL统计数据,大量事务操作后可能不准)
2. exec sp_spaceused '表名', true       --(准确的表空间大小,香港虚拟主机,但可能会花些统计时间)
3. exec sp_spaceused                   -- (数据库大小查询)
4. exec sp_MSforeachtable "exec sp_spaceused '?'"     --(所有用户表空间表小,SQL统计数据,,大量事务操作后可能不准)
5. exec sp_MSforeachtable "exec sp_spaceused '?',true"    --(所有用户表空间表小,大数据库慎用)

,虚拟主机,香港服务器
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Laravel doesn't read POST request with FormData
From 1970-01-01 08:00:00
0
0
0
php - How to optimize this sql?
From 1970-01-01 08:00:00
0
0
0
Error location, SQL statement
From 1970-01-01 08:00:00
0
0
0
node.js - gulp.task async issue
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template