Danish Habib

Danish Habib

  • NA
  • 694
  • 246k

Table Value parameter

Apr 14 2015 5:30 AM
I have an application having hierarchical Data mean cascaded data below is the hierarchy of that database 
District------>populates Tehsils
Tehsils------->Populates UCS
UCS----------->Populates Villages 


Now I want to save these against each user I have created these tables 
User(userid(P),Username)
UserDistrict(DistrictId(P),Districtname,Userid(F))
UserTehsils(TehsilID(P),TehsilName,DistrictId(F),UserId(F))
UserUC(UcID(P),UCNAME,TehsilID(F),UserID(F))
UserVillages(VIllageID(P),VillageName,UCID(F),Userid(F))


I have created Four Method each one is using its own table value parameter , but the problem is that when i am going to save data into the UserTehsil here i need the district id too, so i have created a method in .vb code which pass that Tehsil id to tehsil table and get the district id from there , and my saving process taking more than 3 minutes to get complete any idea.

Answers (2)