From the course: Microsoft SQL Server 2016 Essential Training

Unlock the full course today

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

Using database console commands (DBCC)

Using database console commands (DBCC) - SQL Server Tutorial

From the course: Microsoft SQL Server 2016 Essential Training

Start my 1-month free trial

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 zero allocation errors and zero consistency errors, so that is good, we…

Contents