单个记录的大小?SQL [英] Size of a single Record ? SQL

查看:21
本文介绍了单个记录的大小?SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,每个用户都被分配了 2 MB 的数据库空间.现在我必须显示其分配空间的 Percenatge 使用情况,为此我需要知道表中单个记录的大小.

I have a scenario where every user has been allocated 2 MB of database space. Now I have to show Percenatge usage of their allocated space, to do so I need to know the size of single record in the Table.

我曾尝试使用 sp_spaceused 甚至编写了一个使用 datalength 的自定义过程......但它们的结果差异很大.

I have tried to use sp_spaceused and even wrote a custom procedure making use of datalength .. but they show vast difference in their result.

有什么办法可以解决这个问题.

Is there any way around to get this thing right.

推荐答案

运行 DBCCSHOWCONTIG 与您的表名

dbcc showcontig ('TableName') with tableresults

然后查看最大最小和平均记录大小

then look at max min and average record size

这篇关于单个记录的大小?SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆