IT Log

DROP 본문

SQL/SQL Server

DROP

newly0513 2019. 12. 12. 10:19
728x90
반응형

DROP DATDABASE

 DROP SCHEMA  [ IF EXISTS ] schema_name

Examples

CREATE SCHEMA Sprockets AUTHORIZATION Krishna   
    CREATE TABLE NineProngs (source int, cost int, partnumber int)  
    GRANT SELECT TO Anibal   
    DENY SELECT TO [Hung-Fu];  
GO

DROP TABLE Sprockets.NineProngs;  
DROP SCHEMA Sprockets;  
GO

자세한 설명은 https://docs.microsoft.com/en-us/sql/t-sql/statements/drop-schema-transact-sql?view=sql-server-ver15#examples


DROP DATDABASE

DROP DATABASE [ IF EXISTS ] { database_name | database_snapshot_name } [ ,...n ] [;]

Examples

DROP DATABASE Sales;
DROP DATABASE Sales, NewSales;
DROP DATABASE sales_snapshot0600;

자세한 설명은 https://docs.microsoft.com/en-us/sql/t-sql/statements/drop-database-transact-sql?view=sql-server-ver15#examples


DROP TABLE

DROP TABLE [ IF EXISTS ] { database_name.schema_name.table_name | schema_name.table_name | table_name } [ ,...n ] [ ; ]

Examples

DROP TABLE ProductVendor1 ;
DROP TABLE AdventureWorks2012.dbo.SalesPerson2 ;

CREATE TABLE T1 (Col1 int);  
GO  
DROP TABLE IF EXISTS T1;  
GO  
DROP TABLE IF EXISTS T1;

자세한 설명은 https://docs.microsoft.com/en-us/sql/t-sql/statements/drop-table-transact-sql?view=sql-server-ver15#examples


728x90
반응형

'SQL > SQL Server' 카테고리의 다른 글

[SQL Server] INSERT  (0) 2022.01.17
[SQL Server] DELETE  (0) 2022.01.17
[SQL Server] Data Type  (0) 2022.01.17
[SQL Server] CREATE TABLE  (0) 2022.01.17
[SQL Server] CREATE DATABASE  (0) 2022.01.17
Comments