Database Reference
In-Depth Information
CHECK (LEN(PostalCode) < 10)
--DISABLE the PostalCodeLength constraint
ALTER TABLE Person.Address NOCHECK CONSTRAINT CHK_PostalCodeLength
GO
-- Update the ModifiedData column for specific set of rows
UPDATE Person.Address
SET PostalCode = 980119801298013
WHERE AddressID <= 5
GO
--Enable the CHECK constraint on the table
ALTER TABLE Person.Address CHECK CONSTRAINT CHK_PostalCodeLength
GO
--Obtain post update information
DBCC CHECKCONSTRAINTS ('Person.Address')
This completes the multiple step approach in configuring the manageable database
consistency and integrity process for multiple databases and a VLDB environment. These
are essential in reviewing the important commands to validate and check for issues within
the database.
How it works...
The process of checking and validation of database consistency and integrity will verify the
allocation of data pages and internal structures of specified databases. All the verification and
error messages are logged to SQL Server error log. Besides, setting up an alerting mechanism
to pick up any warning messages that are generated with these DBCC commands will help
solve the problem in a quicker way.
In this recipe, we have initially used the DBCC CHECKALLOC command to verify the allocation
of data pages, which creates an internal database snapshot to maintain transactional
consistency during the operation. Unless otherwise specified, the TABLOCK (table lock) will
not be applied when the snapshot is created, until the operation is completed. The exclusive
lock is applied for a consistency check. All the errors and warnings are generated with a state
number and description.
 
Search WWH ::




Custom Search