Schema changes are uncommon in some businesses. Dropping the objects is unusual too. When deleting any database objects, one must be cautious because it may break applications, application features, or database object dependencies.
This article will show you what you can delete and how to do so.
DROP DATABASE [ IF EXISTS ] dbName;
DROP SCHEMA [ IF EXISTS ] schema_name
DROP TABLE [ IF EXISTS ] tblName;
DROP INDEX ndx_StudentID_tblStudent ON tbStudent.
DROP VIEW vwStudentPayInfo
DROP PROCEDURE uspSomeProc
DROP TRIGGER trgPayHistory
User Defined Function
DROP FUNCTION functionName
DROP USER userName
DROP LOGIN loginName
DROP ROLE roleName
IF EXISTS is optional, but it is recommended if you want to avoid errors.
Hope you find this article helpful.
We are in the process of thoroughly explaining every aspect of SQL Server, from basic to advanced concepts, with syntax and numerous examples. Please go to the index page.