Answer:
• Drop deletes the whole structure of table by means it removes the space for that object from database
• Truncate retains the table structure and removes the all records
Example:
--Truncate table Item
TRUNCATE TABLE Item IMMEDIATELY;
GO
SELECT * FROM Item;
We will get the table structure with no records
--DROP TABLE
DROP TABLE Item
GO
SELECT * FROM Item
GO
We will get the error due to inexistence of object called Item.
Asked In: Many Interviews |
Alert Moderator