Redian新闻
>
请教set和select 的区别
avatar
c*t
2
Who can tell the difference?
555~~~~~~~~~~~~

【在 c**t 的大作中提到】
: In a SP
: declare @x int
: declare @y int
: ...
: what's the difference between "set @[email protected] " and "select @[email protected]"
: Thx.

avatar
n*m
3
where you can use:
select @y = @x?
it is not sql!!!!!!!!

【在 c**t 的大作中提到】
: Who can tell the difference?
: 555~~~~~~~~~~~~

avatar
c*t
4
No problem.
I tried this in query analyzer.

【在 n**m 的大作中提到】
: where you can use:
: select @y = @x?
: it is not sql!!!!!!!!

avatar
t*k
5
在Sybase中
好象要用
select @[email protected] 来赋值吧
有点儿忘了

【在 c**t 的大作中提到】
: In a SP
: declare @x int
: declare @y int
: ...
: what's the difference between "set @[email protected] " and "select @[email protected]"
: Thx.

avatar
aw
6
copied from online
avatar
c*t
7
Interesting. I thought it's rather than that.
I have a SP to do some calculation (as follows). If I use set (--###),
some of '--*' will print " 390 0 ", after that all *B will be 0.
If I use select the two numbers are always the same. That's why I brought
this question.
while (@@fetch_status <> -1)
select @v1=isnull(field, 0) from table1 where @cur_x ..
select @v2=isnull(field, 0) from table2 where @cur_x ...
set @[email protected] --###
set @[email protected] --###
print cast(@v1 as varchar)

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