Redian新闻
>
stored procedure 菜鸟一问, PLEASE HELP,在线等
avatar
stored procedure 菜鸟一问, PLEASE HELP,在线等# Database - 数据库
j*s
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
avatar
D*N
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。