当前在线人数9379
首页 - 分类讨论区 - 电脑网络 - 窗口里的风景版 - 同主题阅读文章

此篇文章共收到打赏
0

  • 10
  • 20
  • 50
  • 100
您目前伪币余额:0
未名交友
[更多]
[更多]
Re: [转载] stored procedure 菜鸟一问, PLEASE HELP,在线等
[版面:窗口里的风景][首篇作者:st] , 2003年10月24日15:57:44 ,213次阅读,3次回复
来APP回复,赚取更多伪币 关注本站公众号:
[分页:1 ]
st
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 1 ]

发信人: st (月光下老虎慢慢吃人), 信区: DotNet
标  题: Re: [转载] stored procedure 菜鸟一问, PLEASE HELP,在线等
发信站: Unknown Space - 未名空间 (Fri Oct 24 15:58:22 2003), 站内信件

of course, try that in your sql analyzer first,
select count(*) from user1 will return a number for the count(*)
that's one row, so you will get @[email protected]@ROWCOUNT, which is 1, :D
【 在 jingus (jing) 的大作中提到: 】
: 【 以下文字转载自 Database 讨论区,原文如下 】
: 发信人: jingus (jing), 信区: Database
: 标  题: stored procedure 菜鸟一问, PLEASE HELP,在线等
: 发信站: Unknown Space - 未名空间 (Fri Oct 24 14:52:54 2003) WWW-POST
: 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 of stored procedure,
: it seems it is different with SQL.
: Thanks a lot!!!!!!!!!!!!!!!
: by the way, I use Microsoft SQl Server


--
一只小老虎慢慢的走了过来。红着脸,问小松鼠说,“请问。。。我可以吃你吗?”
小松鼠觉得这个问法蛮好玩的,说“你是第一次吃动物吗?”小老虎更不好意思了,说,
“是的。。。妈妈不在家了。。。”“那。。你以前吃什么呢?”小松鼠又好奇的问到。
“……”“什么?说大声点。。。我听不到”“吃奶!”说完,小老虎的脸更红更红了。
--[转载]月光下老虎慢慢吃人

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 204.71.]

 
jingus
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 2 ]

发信人: jingus (jing), 信区: DotNet
标  题: Re: [转载] stored procedure 菜鸟一问, PLEASE HELP,在线等
发信站: Unknown Space - 未名空间 (Fri Oct 24 16:11:43 2003) WWW-POST

Thank you so much!
In fact, there are 7 records in the table.
select count(*) from user1;
it will show 7.
So how can I set 7 to @num?
thanks



【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: of course, try that in your sql analyzer first,
: select count(*) from user1 will return a number for the count(*)
: that's one row, so you will get @[email protected]@ROWCOUNT, which is 1, :D
: 【 在 jingus (jing) 的大作中提到: 】
: : 【 以下文字转载自 Database 讨论区,原文如下 】
: : 发信人: jingus (jing), 信区: Database
: : 标  题: stored procedure 菜鸟一问, PLEASE HELP,在线等
: : 发信站: Unknown Space - 未名空间 (Fri Oct 24 14:52:54 2003) WWW-POST
: : 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 of stored
procedure,
: : it seems it is different with SQL.
: : Thanks a lot!!!!!!!!!!!!!!!
: : by the way, I use Microsoft SQl Server
:
:

--
The Tao of Programming
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 129.24.]

 
st
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 3 ]

发信人: st (月光下老虎慢慢吃人), 信区: DotNet
标  题: Re: [转载] stored procedure 菜鸟一问, PLEASE HELP,在线等
发信站: Unknown Space - 未名空间 (Fri Oct 24 16:12:15 2003), 站内信件

select @num=count(*) from user1
this is rather a sql question instead of C# question. :D

【 在 jingus (jing) 的大作中提到: 】
: Thank you so much!
: In fact, there are 7 records in the table.
: select count(*) from user1;
: it will show 7.
: So how can I set 7 to @num?
: thanks
: 【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: : of course, try that in your sql analyzer first,
: : select count(*) from user1 will return a number for the count(*)
: : that's one row, so you will get @[email protected]@ROWCOUNT, which is 1, :D
: copy
: procedure,


--
一只小老虎慢慢的走了过来。红着脸,问小松鼠说,“请问。。。我可以吃你吗?”
小松鼠觉得这个问法蛮好玩的,说“你是第一次吃动物吗?”小老虎更不好意思了,说,
“是的。。。妈妈不在家了。。。”“那。。你以前吃什么呢?”小松鼠又好奇的问到。
“……”“什么?说大声点。。。我听不到”“吃奶!”说完,小老虎的脸更红更红了。
--[转载]月光下老虎慢慢吃人

※ 修改:.st 于 Oct 24 16:12:26 修改本文.[FROM: 204.71.]
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 204.71.]

 
jingus
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 4 ]

发信人: jingus (jing), 信区: DotNet
标  题: Re: [转载] stored procedure 菜鸟一问, PLEASE HELP,在线等
发信站: Unknown Space - 未名空间 (Fri Oct 24 16:13:33 2003) WWW-POST

Thanks, I got it, :-)


【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: select @num=count(*) from user1
: this is rather a sql question instead of C# question. :D
:
: 【 在 jingus (jing) 的大作中提到: 】
: : Thank you so much!
: : In fact, there are 7 records in the table.
: : select count(*) from user1;
: : it will show 7.
: : So how can I set 7 to @num?
: : thanks
: : 【 在 st (月光下老虎慢慢吃人) 的大作中提到: 】
: : : of course, try that in your sql analyzer first,
: : : select count(*) from user1 will return a number for the count(*)
: : : that's one row, so you will get @[email protected]@ROWCOUNT, which is 1, :D
: : copy
: : procedure,
:
:

--
The Tao of Programming
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 129.24.]

[分页:1 ]
[快速返回] [ 进入窗口里的风景讨论区] [返回顶部]
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996