Stored procedures | SQL 2005 Adventure Works OLTP |
Stored procedure using a recursive query to return the direct and indirect employees of the specified manager.
Syntax
dbo.uspGetManagerEmployees ( ManagerID )
Parameters
Variable Data Type Required Output Description ManagerID int Yes No Input parameter for the stored procedure uspGetManagerEmployees. Enter a valid ManagerID from the HumanResources.Employee table.
Properties
Modifies data Transactional Uses cursors Executes procedures Dynamic content Encrypted No No No No No No
Data Source Activity
Accesses Description EMP_cte HumanResources.Employee Employee information such as salary, department, and title. Person.Contact Names of each employee, customer contact, and vendor contact.
Output Recordset
Column Description RecursionLevel ManagerID ManagerFirstName ManagerLastName EmployeeID FirstName LastName
Data source Description EMP_cte HumanResources.Employee Employee information such as salary, department, and title. Person.Contact Names of each employee, customer contact, and vendor contact.
Applies to
Stored procedures | Returns data