如何在SQL Server中检索表行数 [英] how retrive the table row count in sql server

查看:149
本文介绍了如何在SQL Server中检索表行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨家伙

我有一个问题 .如何在SQL Server中检索表行cout?使用asp.net,C#net,sql server.



谢谢&问候.
Nagarajan P

解决方案

请参见Sql COUNT()函数: W3Schools [ ^ ]


 选择 Count(*)TotalRows  From  TableName 



这将返回SQL Server表中的总行数.
创建一个过程并在ASP.NET中使用CommandObject.ExecuteScalar()方法在ASP.NET中获取值

hi guy''s

I have one question . how to retrive the table row cout in sql server? using asp.net,C# net,sql server.



Thank''s & Regards.
Nagarajan P

解决方案

See the Sql COUNT() function: W3Schools[^]


Select Count(*) TotalRows From TableName



This will return you the total number of rows in a table in SQL Server.
Create a procedure and use CommandObject.ExecuteScalar() method in ASP.NET to get the value in ASP.NET


这篇关于如何在SQL Server中检索表行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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