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 - SQL Server Tutorial
From the course: Microsoft SQL Server 2019 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Understand the role of T-SQL1m 59s
-
(Locked)
Use the T-SQL editor6m 4s
-
(Locked)
Create a table with T-SQL5m 28s
-
(Locked)
Add data to a table3m 41s
-
(Locked)
Retrieve records with SELECT3m 28s
-
(Locked)
Filter returned results with WHERE1m 51s
-
(Locked)
Sort records2m 42s
-
(Locked)
Delete records from a table3m 32s
-
(Locked)
Update records in a table3m 4s
-
(Locked)
Join related tables5m 1s
-
(Locked)
LEFT JOIN and RIGHT JOIN2m 16s
-
(Locked)
Remove a table from the database4m 6s
-
(Locked)
-
-
-
-
-
-