Hi i have two column named emp_id and reporting_to
if i login with a emp_id then
how it will return those employees who reporting to the person or who is working under those who is login then what will be the stored procedure for that.
Thanks in Advance
Stored Procedure
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Mittal Sejpal75 reputationPosted Sep 28, 2011, 1:38 AM EDT
Select Empname from your table where reportinto=your Login empID return after login
Rakesh Jha85 reputationPosted Sep 28, 2011, 1:43 AM EDT
(
@EmpId NVARCHAR(20) -- @EmpId of Current Login Person
)
AS
SELECT Emp_id FROM TableName WHERE reporting_to=@EmpId
sunakshi saxena47 reputationPosted Sep 28, 2011, 4:46 AM EDT
this result will show in asp.net page in hierarchical form.please give the code urgently
means i want to add a new form
in that it will show the sp result in hierarchical form
Rakesh Jha85 reputationPosted Sep 28, 2011, 8:49 PM EDT
you can find your solution
http://msdn.microsoft.com/en-us/library/aa478959.aspx