SQL查询数据库中每张表的记录数!
来源:互联网 发布:windows 桌面更新 编辑:程序博客网 时间:2024/06/05 21:00
declare @tbName nvarchar(500)
declare @ct int
declare @csql nvarchar(500)
declare #tb cursor for SELECT OBJECT_NAME (id) As TableName FROM sysobjects WHERE xtype = 'U' AND OBJECTPROPERTY (id, 'IsMSShipped') = 0
open #tb
fetch next from #tb into @tbName
while @@fetch_status=0
begin
set @csql = N'Select @ct= Count(*) From ' + @tbName
Exec dbo.sp_executesql @csql,N'@ct int output',@ct output
Print @tbName + '---' + Cast(@ct As nvarchar(500))
fetch next from #tb into @tbName
end
close #tb
deallocate #tb
declare @ct int
declare @csql nvarchar(500)
declare #tb cursor for SELECT OBJECT_NAME (id) As TableName FROM sysobjects WHERE xtype = 'U' AND OBJECTPROPERTY (id, 'IsMSShipped') = 0
open #tb
fetch next from #tb into @tbName
while @@fetch_status=0
begin
set @csql = N'Select @ct= Count(*) From ' + @tbName
Exec dbo.sp_executesql @csql,N'@ct int output',@ct output
Print @tbName + '---' + Cast(@ct As nvarchar(500))
fetch next from #tb into @tbName
end
close #tb
deallocate #tb
- SQL查询数据库中每张表的记录数!
- SQL查询数据库中每张表的记录数
- Oracle查询每张表的记录数
- 统计数据库中每张表的记录数统计
- 获取每张表的记录数
- mssql查每张表的记录数
- SQL查询数据库中所有表的记录条数
- 脚本查询 SQL数据库 各个表的 记录数
- hibernate HQL查询数据库表中记录的条数
- Oracle查询数据库中所有表的记录数
- 转至Oracle查询数据库中所有表的记录数
- Oracle查询数据库中所有表的记录数
- Oracle查询数据库中所有表的记录数
- 查询Oracle数据库中各个表的实际记录数
- Oracle查询数据库中所有表的记录数
- Oracle查询数据库中所有表的记录数
- sql查询所有表的记录数
- 查询数据库所有表的记录数
- C#通用类实现 读取xml控制Asp.net控件输入信息长度(TextBox,FileUpload)
- Access 和 MS SQL 中合并某个字段的值
- Decrypted Secrets: Methods and Maxims of Cryptology
- 如何制作鼠标感应动画菜单
- 通过Web Services上传和下载文件
- SQL查询数据库中每张表的记录数!
- 专访Andrei:C++会带给我们什么
- 2分法-通用存储过程分页(not in版本)
- CSS:background-position可以指定为负值
- Linux cron 配置样例
- Rootkits: Subverting the Windows Kernel
- My first Vista MCE PLUGIN ---- DVB DATA application plugin
- DataReader分页 与 SQL三种分页方式 - Junval
- 剔除List中的重复值