SQL – DROP ( column, database , table, sps , triggers , views)

Spread the love

SQL – Drop – command is used for deleting an object permanently from Server/Database.

Note – Before deleting an object needs to ensure, that command is executed for particular schema/database/server correctly.

DROP/DELETE A COLUMN FROM TABLE

Syntax – 

ALTER TABLE TABLE_NAME
DROP COLUMN COLUMN_NAME

Query – ALTER TABLE ORDER_ITEM
DROP COLUMN Latest_Status

 

DROP COLUMN

DROP/DELETE A TABLE FROM DATABASE

Syntax –

DROP TABLE TABLE_NAME

Query – DROP TABLE ORDER_ITEM

DROP TABLE

DROP/DELETE A VIEW FROM DATABASE

syntax –

DROP VIEW VIEW_NAME

Query- DROP VIEW Items_View

DROP VIEW

 

DROP / DELETE A STORED PROCEDURE FROM DATABASE

Syntax
DROP PROCEDURE SCHEMA__NAME.PRODUCEDURE_NAME

Query – DROP PROC DBO.SUMMARY_TAB

DROP PROC

 

DROP/DELETE A DATABASE FROM SERVER

Syntax-

DROP DATABASE DATABASE_NAME

Query- DROP DATABASE Item_Master

DROP DATABASE