C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Drop a Database or Table


Posted Date: 22 May 2008    Resource Type: Code Snippets    Category: SQL
Author: vijethaMember Level: Gold    
Rating: Points: 10



The following code sample shows how to Drop a Database or Table


Delete a Table or Database



To delete a table (the table structure, attributes, and indexes will also be deleted):


DROP TABLE table_name

To delete a database:

DROP DATABASE database_name


Truncate a Table:
What if we only want to get rid of the data inside a table, and not the table itself? Use the TRUNCATE TABLE command (deletes only the data inside the table):


TRUNCATE TABLE table_name






Responses

Author: shalini jennifer    23 May 2008Member Level: Gold   Points : 2
Similar to truncate we can use this also:

delete tablename


Author: Nitish Kumar Singh    23 May 2008Member Level: Gold   Points : 2
Hello,


drop database Databasename

drop table tablename

Thanks,
Nitish.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to save point in transactions of Database
Previous Resource: Find Nth highest salary from table
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use