Mostrando entradas con la etiqueta compatibilidad de versiones. Mostrar todas las entradas
Mostrando entradas con la etiqueta compatibilidad de versiones. Mostrar todas las entradas

viernes, 27 de diciembre de 2013

Crear scripts en SQL server 2005 con compatibilidad para SQL Server 2000

Algunas veces creamos scrips en SQL Server 2005 y luego queremos ejecutarlos en SQL SERVER 2000 y no funcionan, hay un wizard que permite adaptarlos.

Los SELECT, INSERT,  UPDATES Y DELETES no tienen problemas de compatibilidad.
La compatibilidad con SQL SERVER 2000 - SQL SERVER 2005  sólo da problemas a la hora de generar objetos del tipo Tabla, Procedimientos almacenados, Vistas, etc.

En primer lugar crearemos en SQL 2005 el script necesario para crear uno de los objetos previamente citados, por ejemplo una tabla.

CREATE TABLE [PROPIETARIO].[tbTabla](
      [strCodigoTabla] [char](7) NOT NULL,
      [strCampo1] [char](4) NOT NULL,
      [strCampo2] [char](9) NOT NULL,
      [strCampo3] [char](7) NOT NULL,
      [strCampo4] [char](7) NOT NULL,
      [strCampo5] [char](9) NOT NULL,
      [strCampo6] [char](7) NOT NULL,
      [strCampo7] [char](7) NOT NULL,
    [intCampo8] [int] NOT NULL,
 CONSTRAINT [PK_tbTabla_4__16] PRIMARY KEY CLUSTERED
(
      [strCodigoTabla] ASC,
      [strCampo1] ASC,
      [strCampo2] ASC,
      [strCampo6] ASC,
      [strCampo7] ASC
     
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]