Top "Dbcc" questions

DBCC stands for Database Console Commands in Transact-SQL.

DBCC SHRINKFILE on log file not reducing size even after BACKUP LOG TO DISK

I've got a database, [My DB], that has the following info: SQL Server 2008 MDF size: 30 GB LDF size: 67 GB I …

sql-server backup transaction-log dbcc
DBCC CHECKDB to check errors in SQL Server database

Is it possible to run: DBCC CHECKDB on a specific table in SQL Server 2005 database? I have the following syntax: …

sql sql-server dbcc
Reduce SQL Server table fragmentation without adding/dropping a clustered index?

I have a large database (90GB data, 70GB indexes) that's been slowly growing for the past year, and the growth/…

sql-server sql-server-2005 fragmentation dbcc database-fragmentation
SQL identity (1,1) starting at 0

I have a SQL table with an identity set: CREATE TABLE MyTable( MyTableID int IDENTITY(1,1) NOT NULL, RecordName nvarchar(100) NULL) …

sql sql-server tsql identity dbcc
How to get table name from database id, file id, page id in MS SQL 2008?

I've deadlock graph in which the locked resource is mentioned by these three fields DB ID, File ID, Page ID. …

sql-server database database-deadlocks dbcc
Currently running query inside a stored procedure

I have a stored procedure that is currently running, and seems to hang/lock on a specific query. How can …

sql-server sql-server-2008 tsql stored-procedures dbcc
tsql to know when dbcc checkdb was run on a database last time

Using Tsql, how can i know when DBCC checkdb was last run on SQL server (2000, 2005 or 2008)? Regards

sql-server dbcc
DBCC shrinkfile gives error

I am trying to shrink my log file using DBCC SHRINKFILE(db_2.ldf), which is the name for log file …

sql-server transaction-log dbcc
DBCC CHECKIDENT(myTable, RESEED,1) reseeding from 2

In SQL Server 2012, the following query is seeding the identity column myTable_id from 2 instead of 1. Why? myTable_id is …

sql-server tsql sql-server-2012 dbcc
Get last command in SQL Server without DBCC INPUTBUFFER

Is there a way to get the last executed SQL Server command without the use of DBCC INPUTBUFFER? For example, …

sql-server dbcc