Transact SQL Commands
Comandos de Transact SQL

D

Comando
Command
Sintaxis Ejemplo
Example
Sirve Para..
Use for...
dbcc dbcc
{ checktable({table_name | table_id } [, skip_ncindex]) |

checkdb [(database_name [, skip_ncindex}) |

checkalloc [(database_name [, fix |  nofix])] |

tablealloc ({table_name |  table_id}
    [, {full | optimized | fast | null}
    [, fix |  nofix]]) |

indexalloc ({table_name |  table_id}, index_id
    [, {full | optimized | fast | null}
    [, fix |  nofix]]) |

checkcatalog [(database_name)] |

dbrepair (database_name, dropdb) |

reindex ({table_name |  table_id}) |

fix_text ({table_name |  table_id}) }

dbcc checkalloc(libros)

dbcc tablealloc(editores, null, nofix)

dbcc checktable(ventas)

dbcc indexalloc ("libros..autor-titulo", 2, full)

dbcc dbrepair(libros, dropdb)

dbcc reindex(titulos)

dbcc fix_text(textest)

Es el inspector de consistencia de la base de datos (dbcc) revisa la consistencia física y lógica de una base de datos. dbcc debería ser usado regularmente, en una revisión periódica o bien cuando se sospecha de daño

Database Consistency Checker (dbcc ) checks the logical and physical consistency of a database. dbcc should be used regularly as a periodic check or if damage is suspected

deallocate cursor deallocate cursor deallocate cursor

Makes a cursor inaccesible and releases all memory resources committed to that cursor

declare declare declare

Declares the name and type of a local variables for a batch or procedure. local variables are assigned values with a select statement

declare cursor declare cursor declare cursor

Defines a cursor

delete delete delete

Removes rows from a table

disk init disk init disk init

Makes a physical device or file usable by SQL server. (It is not necessary to use disk init on the master device, which is initialized by the sybinit installation program.)

disk mirror disk mirror disk mirror

Creates a software mirror that inmediately takes over when the primary devices fails. You can mirror the master device, devices that store data, and devices that store transaction logs; you cannot mirror dump devices

disk refit disk refit disk refit

Rebuilds the master database's sysusages and sysdatabaes system tables from information contained in sysdevices. Use disk refit after disk reinit as part of the procedure to restore the master database

disk reinit disk reinit disk reinit

Rebuilds the master database's sysdevices system table. Use disk reinit as part of the procedure to restore the master database

disk remirror disk remirror disk remirror

Reenables disk mirroring after it is stopped by failure of a mirrored device or temporarily disabled by the disk unmirror command

disk unmirror disk unmirror disk unmirror

Disables either the original device or its mirror, allowing hardware maintenance or the changing of a hardware device

drop database drop database drop database

Removes one or more databases from a SQL Server

drop default drop default drop default

Removes a user-defined default

drop index drop index drop index

Removes an index from a table in the current database

drop procedure drop procedure drop procedure

Removes user-defined stored procedures

drop rule drop rule drop rule

Removes a user-defined rule

drop table drop table drop table

Removes a table definition and all of its data, indexes, triggers, and permission specifications from the database

drop trigger drop trigger drop trigger

Removes a trigger

drop view drop view drop view

Removes one or more views from the current database

dump database dump database dump database

Makes a backup copy of the entire database, including the transaction log, in a form that can be read in with load database

dump transaction dump transaction dump transaction

Makes a copy of transaction log and removes the inactive portion.

no_truncate copies the log without truncating it. Use when the databse is inaccesible after device failure

truncate_only truncates the log without copying it. Use for databses without separating log segment and databases for which you do not need an up_to_date dump

no_log truncates a log without copying it and without logging the event. Use only as a last resort , when your usual method of dumping the transaction log fails because of insufficient log space

[HOME-PRINCIPAL ] [ INFORMATICA ] [ SYBASE ] [ ENLACES ] [ CONTACTENOS ]

© Derechos Reservados, Copyright, DATA-2013, 1999-2003.