Friday, January 29, 2010

SQL Server 2005: Delete Table in Database

Using T-SQL statements, Microsoft's version of SQL (Standard Query Language).
To delete a table in a database let's use this example.
Database called Textbooks. Table called Publishers.
Type
Use Database Textbooks
Go
Drop TABLE Publishers



Among the great SQL resources of Books Online, Microsoft support, MSDN Online, Codezone, and Technet; SQLAuthority.com is useful.

If you've had an error attempting to delete tables, but receiving the message that the database "is currently in use."
See http://blog.sqlauthority.com/2007/12/07/sql-server-fix-error-3702-cannot-drop-database-because-it-is-currently-in-use/

No comments: