Answers for "sql truncate table referencing itself"

SQL
0

sql truncate table referencing itself

-- Original:
UPDATE 'recursive' SET 'parent_id' = NULL WHERE 'parent_id' IS NOT NULL;
DELETE FROM 'recursive';

-- For Example:
UPDATE Items
	SET Items.ParentItemId = NULL 
    WHERE Items.ParentItemId IS NOT NULL;
DELETE FROM Items;
-- Or 
TRUNCATE TABLE Items;
Posted by: Guest on April-23-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language