select [表总记录数]=rows from sysindexes where id = object_id('表名')
CREATE PROCEDURE PROC1 AS BEGIN SET NOCOUNT ON SELECT [表总记录数]=ROWS FROM SYSINDEXS WHERE id = OBEJECT('表名') SET NOCOUNT OFF END fCount=Conn.Execute ("EXEC PROC1",0,1)(0)
SELECT [表总记录数]=ROWS FROM sysindexes WHERE id = object_id('表名')
三楼的看得明白点,可是没带where条件进去呀?
create table a(id int,name varchar(10)) insert into a select 1,'a' insert into a select 2,'b' insert into a select 3,'c'select * from acreate proc proc_a @name varchar(10), @count int out as begin select @count=count(*) from a where name=@name enddeclare @count int,@name varchar(10) set @name='c' exec proc_a @name,@count out select @count as '数量'数量 1
请各位参照我原来的那句SQL好不好??谢谢了
isLock--为bit类型时, 楼主贴出来语句已是最简单的了。。 select rows from sysindexes where object_id('T')=ID and indid in(0,1)--这统计整个表的记录不能用,楼主的有条件isLock
CREATE PROCEDURE PROC1
AS
BEGIN
SET NOCOUNT ON
SELECT [表总记录数]=ROWS FROM SYSINDEXS WHERE id = OBEJECT('表名')
SET NOCOUNT OFF
END
fCount=Conn.Execute ("EXEC PROC1",0,1)(0)
SELECT [表总记录数]=ROWS FROM sysindexes WHERE id = object_id('表名')
insert into a select 1,'a'
insert into a select 2,'b'
insert into a select 3,'c'select * from acreate proc proc_a
@name varchar(10),
@count int out
as
begin
select @count=count(*) from a where name=@name
enddeclare @count int,@name varchar(10)
set @name='c'
exec proc_a @name,@count out
select @count as '数量'数量
1
楼主贴出来语句已是最简单的了。。
select rows from sysindexes
where
object_id('T')=ID and indid in(0,1)--这统计整个表的记录不能用,楼主的有条件isLock