If you are a SQL Server administrator or just working with it, these commands would be use full for you.
Modifies an existing table or view index (relational or XML) by disabling, rebuilding, or reorganizing the index; or by setting options on the index.
Rebuilds one or more indexes for a table in the specified database.
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER INDEX instead.
Defragments indexes of the specified table or view.This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER INDEX instead.
Displays defragmentation information for data and indexes of a specified table.
Shrinks the size of the data and log files in the specified database.
Shrinks the size of the specified data or log file for the current database or empties a file by moving the data from the specified file to other files in the same filegroup, allowing the file to be removed from the database.
Terminates a user proces. It uses the spid as an identifier, and can therefore with benifit be used in combination with sp_who2.Notice – if the specified session ID has a lot of work to undo, the KILL statement may take some time to complete, particularly when it involves rolling back a long transaction.
Displays active locks.
Displays the number of rows, disk space reserved, and disk space used by a table, indexed view, or SQL Server 2005 Service Broker queue in the current database, or displays the disk space reserved and used by the whole database.
Displays information about current users and processes.
Displays information about current users and processes. It is a function similar to sp_who. The big difference is that it also displays CPU usages and DiskIO. So if possible, always use this command.
Leave a Reply