Search
 
SCRIPT & CODE EXAMPLE
 

SQL

drop table with constraints

1. 'First Drop contrstraints like this'
ALTER TABLE table_name
DROP CONSTRAINT constraint_name;
2. 'Then drop table'
DROP TABLE table_name;
Comment

DROP TABLes regardless of constraints

SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE <table_name>

-- if you want to later add or modify foreign keys
SET FOREIGN_KEY_CHECKS = 1;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server locks 
Sql :: datediff in sql server 
Sql :: vbscript connect mssql 
Sql :: mysql update with subquery 
Sql :: select nextval from sequence oracle 
Sql :: how to extract year from date in sql 
Sql :: mysql create view full table 
Sql :: describe table postgres 
Sql :: create sequence postgres 
Sql :: mysql utc timestamp 
Sql :: mysql show all table from database 
Sql :: sql compare strings 
Sql :: how to show index type in postgresql 
Sql :: sequelize migration default value 
Sql :: search mysql database for column 
Sql :: create mysql database on windows 
Sql :: mysql group by range 
Sql :: mysql change timestamp on update 
Sql :: how to select unique element in sql 
Sql :: sql sum by column 
Sql :: rename table sql server 
Sql :: oracle sql drop column if exists 
Sql :: sql count null as 0 
Sql :: constraints to columns SQL 
Sql :: download sql server 2016 
Sql :: mysql collation for all languages 
Sql :: mysql remove first and last character from string 
Sql :: mysql get last 2 month data 
Sql :: osx stop mysql service 
Sql :: Create boolean column in MySQL with false as default value? 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =