Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

how can i delete data child and parent tables with out delete their relationship.
is it possible...?
thanks in advance
Posted

You can't delete tables and keep the relationship if you want to keep the relationship you need to keep the tables and just delete the content!

Cascading Delete[^]
 
Share this answer
 
v2
Comments
K N R 14-Oct-11 9:03am    
hey simon,
am not delete tables, only delete content.
Simon_Whale 14-Oct-11 9:04am    
Updated the answer text.. Cascading delete is what you are after using.
Simon Bang Terkildsen 14-Oct-11 9:09am    
Indeed, my 5
Simon_Whale 14-Oct-11 9:10am    
Thanks Simon :)
Simon Bang Terkildsen 14-Oct-11 9:07am    
Ahh ok, I get it now, delete content not tables :)
As Simon said cascade delete is an option and a simple and easy one. Another option is to delete the "child data" first then the parent(s).
No ofcourse not, if you delete the tables then there are no tables to have a relationship between.
 
Share this answer
 
Comments
K N R 14-Oct-11 8:55am    
hey simon,
first to find child tables and find is their any relationship if their then find parent table. in this way is working or not..?
can you please help me.
Simon Bang Terkildsen 14-Oct-11 9:05am    
Sorry, I don't think I understand what you're asking.
If you're asking if it is possible to find all tables that some random table has a relationship to then yes. But it's not easy however, but if you google t-sql table get relationships you should be able to find plenty of discussions about how you can do it, the first two hits seem promising.
K N R 15-Oct-11 5:04am    
thanks for your solution

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