i have a question:
i have a table that has an identity id column called pId and also a column called ParentPid.
now my question is that i want to insert the value of pId into the ParentPid when i'm adding a new Property to a table.
i have properties and subproperties i need to select properties and under that put subproperties and this is i'm doing it with the check of ParentPId = PId and i have also the Plevel, if Plevel = 1 then it is category and if Plevel = 2 then it is subcategory.
first of all i'm working with prperties: so i have a datalist that shows all the properties, in these properties i have Property and i have subproperties and i'm distinguishing between them with a colunm in my table called level, so if a property has level = 1 then it is a property, if level = 2 then it is subproperty. now when i want to show the properties and subproperties i'm querying my table as that:
select * from property where level = 2 and parentPId = PropertyId so i wll show just the subproperties of a specific property.
now the PropertyId is an identity so the id is generating automatically, now what i want is a way so i can insert this propertyid into the ParentPId?