Hi I have a condition as follows : where I am passing the parameters Name and ID to the SP
and I am extracting Name1 and ID1 from the table student.
Now if the name extracted is the same as name passed I want it to update.
Below is the code.
However I think its not functioning because I need to put a for loop and extract all names present and the compare it.
Please advice me on the approach, Any help will be greatly appreciated.
---------------------------------------------------------
Select @Name1 = @Name from tbl_student
Select @id = @id from tbl_student
Set @id1 = substring(@id,7,1)
If
( @Name1 = @Name and @id1 = @id)
update dbo.tbl_student
set Name=@Name1,
Id =@Id1 where Id= ID1
end