Hello friend
How we can set parameter value in select statement.
How I can set first column value in parameter @ID In stored procedure... can we do it without courser.Code:Declare @ID decimal(18,2)
Select TOP 1 StudentId from Table1
Thanks
Shakti
Printable View
Hello friend
How we can set parameter value in select statement.
How I can set first column value in parameter @ID In stored procedure... can we do it without courser.Code:Declare @ID decimal(18,2)
Select TOP 1 StudentId from Table1
Thanks
Shakti
This?
Code:SET @ID = Select TOP 1 StudentId from Table1
I am getting error incorrect syntax error.
Code:Declare @TotalAssessedValue decimal(18,2)
SET @TotalAssessedValue = select TOP 1 totalassdval from VTable order by CYear desc
Erm.. what is that WHERE doing there?
Thanks I had done that but still same problem
Try it like this:
Code:SET @TotalAssessedValue = (select TOP 1 totalassdval from VTable order by CYear desc);
thanks
now if we have two parameter than?
Code:SET @TotalAssessedValue1,@TotalAssessedValue2 = (select TOP 1 A,B from VTable order by CYear desc);
You must use the Select statement to set multiple local variables at once
Select TOP 1 @TotalAssessedValue1 = A, @TotalAssessedValue2 = B from VTable order by CYear desc
Thanks I got that