c**t 发帖数: 2744 | 1 In a SP
declare @x int
declare @y int
...
what's the difference between "set @y=@x " and "select @y=@x"
Thx. |
c**t 发帖数: 2744 | 2 Who can tell the difference?
555~~~~~~~~~~~~
【在 c**t 的大作中提到】 : In a SP : declare @x int : declare @y int : ... : what's the difference between "set @y=@x " and "select @y=@x" : Thx.
|
n**m 发帖数: 255 | 3 where you can use:
select @y = @x?
it is not sql!!!!!!!!
【在 c**t 的大作中提到】 : Who can tell the difference? : 555~~~~~~~~~~~~
|
c**t 发帖数: 2744 | 4 No problem.
I tried this in query analyzer.
【在 n**m 的大作中提到】 : where you can use: : select @y = @x? : it is not sql!!!!!!!!
|
t********k 发帖数: 808 | 5 在Sybase中
好象要用
select @y=@x 来赋值吧
有点儿忘了
【在 c**t 的大作中提到】 : In a SP : declare @x int : declare @y int : ... : what's the difference between "set @y=@x " and "select @y=@x" : Thx.
|
aw 发帖数: 127 | |
c**t 发帖数: 2744 | 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 @v1B=@v1 --###
set @v2B=@v2 --###
print cast(@v1 as varchar)
【在 aw 的大作中提到】 : copied from online
|