In SQL Server 2005, can I do a cascade delete without setting the property on my tables?

前端 未结 13 1462
心在旅途
心在旅途 2020-12-12 17:02

I have a database full of customer data. It\'s so big that it\'s really cumbersome to operate on, and I\'d rather just slim it down to 10% of the customers, which is plenty

13条回答
  •  独厮守ぢ
    2020-12-12 17:42

    I usually just hand write the queries to delete the records I don't want and save that as a .sql file for future reference. The pseudocode is:

    1. select id's of records from the main table that I want to delete into a temp table
    2. write a delete query for each related table which joins to the temp table.
    3. write a delete query for the main table joining to my temp table.

提交回复
热议问题