Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: First Step in installing SQL workbench 
Sql :: delphi split datetime 
Sql :: oracle sql winter time change 
Sql :: use mysql 8 without password 
Sql :: postgresql interview questions 
Sql :: mysql remote connection macos 
Sql :: trigger stock phpmyadmin 
Sql :: sqldf change user 
Sql :: postgres multiple left join causing duplicates jsonb_agg 
Sql :: oracle single row functions 
Sql :: SQlite script 
Sql :: how to make trigger in phpmyadmin 
Sql :: express api ith mysql data 
Sql :: convert sql to linq online converter 
Sql :: mysql conf.d exampel 
Sql :: horizontal join sqlite 
Sql :: mysl like insert a variable 
Sql :: amount of entries in a table psql 
Sql :: phpmyadmin tabellentyp ändern 
Sql :: merge query using linked server 
Sql :: python sql passer des parametres dans une requet pymysql 
Sql :: my sql data file extention 
Sql :: select into a new table mysql 
Sql :: convert sql query to linq online 
Sql :: difference between on and where in sql 
Sql :: check or repair mysql database table 
Sql :: how to delete a database record after a certain time 
Sql :: check mysql password with docker container magento 2 
Sql :: plsql to generate all combinations of specified number of characters in string 
Sql :: fill a coulmn with a certain value sql 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =