From the course: Microsoft SQL Server 2019 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Remove a table from the database

Remove a table from the database - SQL Server Tutorial

From the course: Microsoft SQL Server 2019 Essential Training

Start my 1-month free trial

Remove a table from the database

- [Instructor] If you need to remove a large number of records from your database, you have two different options. I'm going to finish up the script that we started earlier in the chapter that built the Landon Hotel Rooms table. Right now, we have a CREATE TABLE statement, up here at the top, that builds the room's structure. Then, we insert a number of records into the table, and finally, we select that data back out again to review the contents that are stored on the database server. I'm going to come up here, to the very top of my script, and I'll press enter a couple of times to make myself some additional room, and I want to enter in a line that'll remove all of the data from the room's table. This statement will be TRUNCATE TABLE Rooms. Before I run this, I want to make sure that I'm targeting the Landon Hotel database, using this dropdown menu in the menu, and I'm going to double-click here to highlight this whole row, and execute just that TRUNCATE TABLE statement. I get the…

Contents