Cred Interview Question | Table Drop
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 2 )
YES, It drops all related objects, which exists INSIDE a table like, constraints, indexes, columns, defaults, etc. BUT dropping a table will not drop Views and Stored Procedures as they exist OUTSIDE the table
When SQL Server drops a table, it also deletes all data, triggers, constraints, permissions of that table.
Moreover, SQL Server does not explicitly drop the views and stored procedures that reference the dropped table.
Therefore, to explicitly drop these dependent objects, you must use the DROP VIEW and DROP PROCEDURE statement.
Reference:
https://www.sqlservertutorial.net/sql-server-basics/sql-server-drop-table/