Hi,
declare @FirstLocationNotZero int
select @FirstLocationNotZero = top 1 Location from dbo.Table1--------------see wrong one
where value<>0
print @FirstLocationNotZero
I should obtain 2, instead of:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'top'
Solution:
declare @FirstLocationNotZero int
select top 1 @FirstLocationNotZero = Location ------------------------> see Right one
from dbo.Table1
where value<>0
print @FirstLocationNotZero
declare @FirstLocationNotZero int
select @FirstLocationNotZero = top 1 Location from dbo.Table1--------------see wrong one
where value<>0
print @FirstLocationNotZero
I should obtain 2, instead of:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'top'
Solution:
declare @FirstLocationNotZero int
select top 1 @FirstLocationNotZero = Location ------------------------> see Right one
from dbo.Table1
where value<>0
print @FirstLocationNotZero
No comments:
Post a Comment