SELECT count(*) FROM BUS_tb_UserGradePrice
select count(userid) from BUS_tb_UserGradePrice where userid is not NULL
SELECT rows FROM sysindexes WHERE id = OBJECT_ID('dbo.BUS_tb_UserGradePrice') AND indid < 2
**其中“dbo.BUS_tb_UserGradePrice”为需要查找的表名
-- 第4种 存储过程获取总记录数ALTER PROCEDURE [dbo].[sp_RowCount]
@table NVARCHAR(100)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @tb TABLE(name SYSNAME,[RowCount] NVARCHAR(4000),c NVARCHAR(4000),d NVARCHAR(4000),e NVARCHAR(4000),f NVARCHAR(4000))
INSERT INTO @tb EXEC sp_spaceused @table
SELECT TOP 1 [RowCount] FROM @tb
END