|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with a quarry
I have a database it is made up of about 30 tables.The database is used for a game server. When someone deletes there char the char isn't removed from the database, so today i manually deleted all the deleted chars, about 13,000 in total. The problem is the char names and details are stored in 4 other tables, and i need to delete them from these tables. So i now have a list of 13,000 names (in a text file at the moment), but i am unsure of how to add them to a query. Any one got any ideas? Thanks lapta |
|
#2
|
|||
|
|||
|
I don't know about your current problem, but for the future I would suggest modifying your foreign key relations and set the Delete rule to Cascade. That way when you delete a character it will automatically delete all that other stuff.
|
|
#3
|
||||
|
||||
|
Quote:
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#4
|
|||
|
|||
|
Quote:
how would i do that? |
|
#5
|
||||
|
||||
|
Quote:
1. restrict or 2. set null rule so that: 1. You have to clean up dependent tables before deleting or 2. You can easily find out the rows related to the item you deleted |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help with a quarry |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|