Creada el: 28/09/98 - Actualizada el: 28/09/98

Guía de Referencia Rápida

Página 3/16
WB01343_.gif (1341 bytes)WB01345_.gif (616 bytes)


DECLARE Statement                                                                
Used to define the name and type of local variables for a batch or               
procedure, and to define cursors.                                                
                                                                                 
DECLARE @<variable_name> <datatype>                                              
     [, @<variable_name> <datatype>...]                                          
                                                                                 

DECLARE Statement                                                                
Defines a cursor. Once declared, row sets for cursors are assigned by            
using the OPEN statement. (The DECLARE statement can also be used to             
define the name and type of local variables for a batch or procedure.)           
                                                                                 
DECLARE <cursor_name> [INSENSITIVE] [SCROLL] CURSOR                              
FOR <select_statement>                                                           
[FOR {READ ONLY | UPDATE [OF <column_list>]}]                                    
                                                                                 

DELETE Statement                                                                 
Removes rows from a table.                                                       
                                                                                 
DELETE [FROM] {<table_name> | <view_name>}                                       
     [WHERE clause]                                                              
                                                                                 
Transact-SQL extension Syntax:                                                   
DELETE [FROM] {<table_name> | <view_name>}                                       
     [FROM {<table_name> | <view_name>}                                          
          [, {<table_name> | <view_name>}]...]                                   
               [..., {<table_name16> | <view_name16>}]]                          
[WHERE clause]                                                                   
                                                                                 

DISK INIT Statement                                                              
Creates a device on which a database or multiple databases can be                
placed. A device is an operating-system file that SQL Server pre-                
allocates for database use.                                                      
                                                                                 
DISK INIT                                                                        
     NAME = '<logical_name>',                                                    
     PHYSNAME = '<physical_name>',                                               
     VDEVNO = <virtual_device_number>,                                           
     SIZE = <number_of_2K_blocks>                                                
[, VSTART = <virtual_address>]                                                   
                                                                                 

DISK MIRROR Statement                                                            
Creates a software image of the SQL Server device.                               
                                                                                 
DISK MIRROR                                                                      
     NAME = '<logical_name>',                                                    
     MIRROR = '<physical_name>'                                                  
     [, WRITES = {SERIAL | NOSERIAL}]                                            
                                                                                 

DISK REFIT Statement                                                             
Restores usage information from the system tables when a device exists           
(the file is present) but the entries in the sysusages table no longer           
exist. This occurs after a damaged master database is restored and the           
master database is incomplete (databases and devices were added or               
altered since the last backup of master).                                        
                                                                                 
DISK REFIT                                                                       
                                                                                 

DISK REINIT Statement                                                            
Restores the device entries to the system tables when a device exists            
(the file is present) and the entry in the sysdevices table no longer            
exists. This occurs after a damaged master database is restored and the          
master database is incomplete (databases and devices were added or               
altered since the last backup of master). This is the first step for             
restoring access to user databases. The DISK REFIT statement completes           
the recovery.                                                                    
                                                                                 
DISK REINIT                                                                      
     NAME = '<logical_name>',                                                    
     PHYSNAME = '<physical_name>',                                               
     VDEVNO = <virtual_device_number>,                                           
     SIZE = <number_of_2K_blocks>                                                
     [, VSTART = <virtual_address>]                                              
                                                                                 

DISK REMIRROR Statement                                                          
Resumes software mirroring for the SQL Server device.                            
                                                                                 
DISK REMIRROR                                                                    
     NAME = '<logical_name>'                                                     
                                                                                 

DISK RESIZE Statement                                                            
Allows you to expand a device. You can use DISK RESIZE on any database           
device, including the MASTER device.                                             
                                                                                 
DISK RESIZE                                                                      
     NAME = <logical_device_name>,                                               
     SIZE = <final_size>                                                         
                                                                                 

DISK UNMIRROR Statement                                                          
Temporarily pauses software mirroring for the SQL Server device. Often           
this is useful when large non-logged operations are occurring against            
the database and when a database backup (using the DUMP statement) will          
be performed after the non-logged operations finish.                             
                                                                                 
DISK UNMIRROR                                                                    
     NAME = '<logical_name>'                                                     
     [, SIDE = {PRIMARY | SECONDARY}]                                            
     [, MODE = {RETAIN | REMOVE}]                                                
                                                                                 

DROP DATABASE Statement                                                          
Removes one or more databases from SQL Server.                                   
                                                                                 
DROP DATABASE <database_name> [, <database_name>...]                             
                                                                                 

DROP DEFAULT Statement                                                           
Removes a user-defined default from a database.                                  
                                                                                 
DROP DEFAULT [<owner>.]<default_name> [, [<owner>.]<default_name>...]            
                                                                                 

DROP INDEX Statement                                                             
Removes an index from a database.                                                
                                                                                 
DROP INDEX [owner.]<table_name>.<index_name>                                     
              [, [owner.]<table_name>.<index_name>...]                           
                                                                                 

DROP PROCEDURE Statement                                                         
Removes user-created stored procedures from the current database.                
                                                                                 
DROP PROCedure [<owner>.]<procedure_name>                                        
                   [, [<owner>.]<procedure_name>...]                             
                                                                                 

DROP RULE Statement                                                              
Removes a user-specified rule from a database.                                   
                                                                                 
DROP RULE [<owner>.]<rule_name>                                                  
              [, [<owner>.]<rule_name>...]                                       
                                                                                 

DROP TABLE Statement                                                             
Removes a table definition and all data, indexes, triggers, constraints, and     
permission specifications for that table from the database.                      
                                                                                 
DROP TABLE [[<database>.]<owner>.]<table_name>                                   
               [, [[<database>.]<owner>.]<table_name>...]                        
                                                                                 

DROP TRIGGER Statement                                                           
Removes a trigger from a database.                                               
                                                                                 
DROP TRIGGER [<owner>.]<trigger_name>                                            
                 [, [<owner>.]<trigger_name>...]                                 
                                                                                 

DROP VIEW Statement                                                              
Removes a view from a database.                                                  
                                                                                 
DROP VIEW [<owner>.]<view_name>                                                  
              [, [<owner>.]<view_name>...]       
                                                                                 
Página 3/16
WB01343_.gif (1341 bytes)WB01345_.gif (616 bytes)

Página Inicial

Por Luis Walter Reynoso para Ethek & Friends