Set select + variable | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Set select + variable

Hi ,is it possible use some statement . Declare @sqlCommand varchar(255) , @param int
set select @param= param from Table where pilot= 1 …. It isn’problem BUt when I want use some parameter with statement, I don’t know correct syntax Sample :
Set Select @param= param From Table Where pilot= + @param ( @param is variable in procedure)
Iknow statement is wrong, but is it possible make any…
I need to write statement
Thanks, Lubo[?]
Not sure how formal you were making your code, but I see a couple of problems. 1, why do you have "set select …"? 2, why do you have a plus sign after the equal sign in your Sample? I’m taking a stab @ what you’re really wanting, but replace this…
Set Select @param= param From Table Where pilot= + @param with this…
select @param = param From Table Where pilot = @param …see if that works.

Not that if there more than one param value for that pilot then @param will have last param value Madhivanan Failing to plan is Planning to fail
]]>