I have the below senario.
Create table Emp
(
Ecode_12345 varchar(25),
Ecode_54321 varchar(25),
Ecode_98765 varchar(25)
)
insert into Emp
Select 'Salary-12500','Salary-30000','Salary-50000'
union all
Select 'Age-25','Age-37','Age-42'
Now my requirement is, if i give 12345 as the parameter, i want the Ecode_12345 details.
Say for example,
Create procedure p1
(
@Ecode int
)
as
begin
end
exec p1 12345
will display the below result.
Salary-12500
Age-25
Inputs are welcome !