j****s 发帖数: 34 | 1 I want to know how many records existing in the database.
In sql, it is
select count(*) from customer;
But I do not know how to get it in stored procedure.
CREATE proc countcustom @num Int output
as
select count(*) from user1
select @num = @@ROWCOUNT
return
GO
But num is always 1, since I do not know the meaning of @@ROWCOUNT, ( I copy
from other examples, :-()
I wonder somebody can help me, also is there any document or tutorai for
stored procedure? I do not quite understand the grammar o | D****N 发帖数: 430 | 2 SELECT @num = (SELECT COUNT(*) FROM user1)
【在 j****s 的大作中提到】 : I want to know how many records existing in the database. : In sql, it is : select count(*) from customer; : But I do not know how to get it in stored procedure. : CREATE proc countcustom @num Int output : as : select count(*) from user1 : select @num = @@ROWCOUNT : return : GO
|
|