Ms SQL Server 2000 some useful T-SQL.

Source: Internet
Author: User

SQL Server 2000 DBCC statements use input parameters and return values. All DBCC statement parameters can accept Unicode and DBCS literal values.

Use DBCC result set output

Many DBCC commands can generate output in table format (using the with tableresults option ). This information can be loaded into the table for future use. The following shows an example script:

 
-- Create the table to accept the resultscreate table # tracestatus (traceflag int, status INT) -- execute the command, putting the results in the tableinsert into # tracestatus exec ('dbcc tracestatus (-1) with no_infomsgs ') -- display the resultsselect * from # tracestatusgo
Maintenance statement

DBCC dbreindex

DBCC dbrepair

DBCC indexdefrag

DBCC shrinkdatabase

DBCC shrinkfile

DBCC updateusage

Miscellaneous statements

DBCC dllname (free)

DBCC help

DBCC pintable

DBCC rowlock

DBCC traceoff

DBCC traceon

DBCC unpintable

Status statement

DBCC pintable

DBCC opentran

DBCC outputbuffer

DBCC proccache

DBCC showcontig

DBCC show_statistics

DBCC sqlperf

DBCC tracestatus

DBCC useroptions

Verification statement

DBCC checkalloc

DBCC checkcatalog

DBCC checkconstraints

DBCC checkdb

DBCC checkfilegroup

DBCC checkident

DBCC checktable

DBCC newalloc

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.