From the course: Microsoft SQL Server 2016 Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using database console commands (DBCC)

Using database console commands (DBCC) - SQL Server Tutorial

From the course: Microsoft SQL Server 2016 Essential Training

Using database console commands (DBCC)

- [Instructor] In this section, we're going to talk about a tool in Microsoft SQL Server 2016 called Database Console Commands, or DBCC. This tool is entirely text-based. There's no graphical interface. So inside of management studio, I'll open up a new query. And the first command I'll run is DBCC space CheckDB and then in parenthesis I'll need to pass the name of the database I would like to check. So I'll go with WideWorldImporters and we'll execute that command. DBCC can take a little while on a large database, so you'll need to be patient with it. And when the results come up we get quite a bit of information. The check database has checked all of the files for any physical problems with them and checked all of the tables and other structures for any logical problems with them. Generally you can scroll all the way down to the bottom and look at the last few lines. The second to last line says CheckDB found…

Contents