Recursive function using cursor in sql
I have parent category id in the category table.(same table). When add category there is two options. First one if we create new category without selecting the existence category than its became the parent category. Second one if we create the category with select the existence category that selected category become the parent category. So now i want to select all the category and subcategory by using Cusor and recursive function on sql. This is possible? How?