Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
employee_id manager_id designation
101 NULL CEO
102 101 GM
103 102 MANAGER
104 103 SOFTWARE ENGINEER
105 103 SOFTWARE ENGINEER


In this data structure i want make a hierarchi of superior employee id 104


SQL
SELECT employee_id,manager_id,designation FROM manager
CONNECT by prior employee_id = 104



This is the query what am used in this am getting the error like this

Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'by'.

help me to solve this....
Posted

use hierarchyid which is present as datatype in sql server 2008.
 
Share this answer
 
Comments
prabakaransat 24-Apr-12 4:33am    
i didn't got your point
VJ Reddy 24-Apr-12 4:55am    
Good point. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900