DROP TABLE在不同数据库中的写法整理,droptable
DROP TABLE在不同数据库中的写法整理
1,MySql中
DROP TABLE IF EXISTS [table_name]
2,Oracle中:
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE [table_name]';
EXCEPTION WHEN OTHERS THEN NULL;
END;
3,在Sql Server中
IF EXISTS (
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = '[table_name]')
DROP TABLE [table_name]
end. enjoy it! LOL