Últimos mensajes - Powered by IBM
- Normalización
- Normalización
- Error -2147221503 [ODBC SQL Server ...
- Sql Server Backups
- sql server
- informe de consumo mensual
- rangos de fecha
- error con instancia en sql server 2005 express ...
- Conexion via Programacion a SQL SERVER 2008 R2
- Exportar datos desde un archivo de Texto a SQL ...
Palabras claves
depurar SQL de SQL 2005 a SQL server 2000
03/11/2008 - 11:21 por gandalias | Informe spam
Hola,
Tengo que pasar este código a sql 2000, pero me da montón de errores.
Existe algun depurador o "traductor" de SQL de SQL 2005 a SQl de SQL 2000
O que línea quito o como puedo saber cuales quitar.
Estos son los errores:
Servidor: mensaje 170, nivel 15, estado 1, línea 19
Línea 19: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 37
Línea 37: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 54
Línea 54: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 74
Línea 74: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 95
Línea 95: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 111
Línea 111: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 127
Línea 127: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 145
Línea 145: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 166
Línea 166: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 182
Línea 182: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 213
Línea 213: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 232
Línea 232: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 255
Línea 255: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 297
Línea 297: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 333
Línea 333: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 356
Línea 356: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 378
Línea 378: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 398
Línea 398: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 417
Línea 417: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 435
Línea 435: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 454
Línea 454: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 470
Línea 470: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 513
Línea 513: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 529
Línea 529: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 548
Línea 548: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 570
Línea 570: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 589
Línea 589: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 609
Línea 609: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 633
Línea 633: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 653
Línea 653: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 681
Línea 681: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 700
Línea 700: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 720
Línea 720: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 737
Línea 737: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 754
Línea 754: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 772
Línea 772: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 790
Línea 790: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 806
Línea 806: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 824
Línea 824: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 840
Línea 840: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 857
Línea 857: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 876
Línea 876: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 886
Línea 886: sintaxis incorrecta cerca de '('.
Y este el código:
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE DATABASE galipres;
USE galipres
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[inf_archivo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[inf_archivo](
[tipo] [nvarchar](50) NOT NULL,
[fecha] [datetime] NOT NULL,
[descripcion] [nvarchar](100) NOT NULL,
[informe] [text] NOT NULL,
CONSTRAINT [PK_inf_archivo] PRIMARY KEY CLUSTERED
(
[tipo] ASC,
[fecha] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[calendarios_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[calendarios_horarios](
[id_calendarios_horarios] [int] NOT NULL,
[id_calendario] [int] NULL,
[anio] [int] NULL,
[horarios] [text] NULL,
CONSTRAINT [PK_calendarios_horarios] PRIMARY KEY CLUSTERED
(
[id_calendarios_horarios] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[sel_personal]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sel_personal](
[id_sel_personal] [int] NOT NULL,
[nombre] [varchar](50) NULL,
[codigos] [text] NULL,
CONSTRAINT [PK_sel_personal] PRIMARY KEY CLUSTERED
(
[id_sel_personal] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[cambios_turno]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[cambios_turno](
[id_cambio_turno] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[ventanas_incidencia] [bit] NULL,
[tiempo_min_marcajes] [nvarchar](5) NULL,
[tiempo_max_turno] [nvarchar](5) NULL,
[color] [int] NULL,
CONSTRAINT [PK_cambios_turno] PRIMARY KEY CLUSTERED
(
[id_cambio_turno] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[fichajes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[fichajes](
[id_fichajes] [int] NOT NULL,
[tarjeta] [int] NULL,
[fecha] [datetime] NULL,
[id_incidencia] [int] NULL,
[baja] [bit] NULL,
[terminal] [nvarchar] (20) NULL,
[manual] [bit] NULL,
CONSTRAINT [PK_fichajes] PRIMARY KEY CLUSTERED
(
[id_fichajes] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[categorias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[categorias](
[id_categoria] [int] NOT NULL,
[nombre] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_categorias] PRIMARY KEY CLUSTERED
(
[id_categoria] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tipos_incidencias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tipos_incidencias](
[id_tipos_incidencias] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_tipos_incidencias] PRIMARY KEY CLUSTERED
(
[id_tipos_incidencias] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[Categorias_Coste_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Categorias_Coste_hora](
[id_categoria_coste_hora] [int] NOT NULL,
[id_categoria] [int] NULL,
[id_tipo_hora] [int] NULL,
[coste_hora] [money] NULL,
CONSTRAINT [PK_Categorias_Coste_hora] PRIMARY KEY CLUSTERED
(
[id_categoria_coste_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[variaciones]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[variaciones](
[id_variaciones] [int] NOT NULL,
[id_personal] [int] NULL,
[desde] [datetime] NULL,
[hasta] [datetime] NULL,
[concepto] [int] NULL,
[id_concepto] [int] NULL,
[observaciones] [text] NULL,
CONSTRAINT [PK_variaciones] PRIMARY KEY CLUSTERED
(
[id_variaciones] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[convenios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[convenios](
[id_convenio] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_convenios] PRIMARY KEY CLUSTERED
(
[id_convenio] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias](
[id_incidencia] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[clave_informes] [nvarchar](7) NULL,
[varios_dias] [bit] NULL,
[permitida_festivos] [bit] NULL,
[tipo] [int] NULL,
[contar_dias] [bit] NULL,
[contar_medios_dias] [bit] NULL,
[contar_horas] [bit] NULL,
[maximo_diario] [nvarchar](5) NULL,
[compensar_horas] [bit] NULL,
[pagada_pres_corregida] [bit] NULL,
[redondear_marcajes] [bit] NULL,
[tiempo_contabilizado] [int] NULL,
[tipo_hora_tc] [int] NULL,
[maximo_anual] [int] NULL,
[sin_absentismo] [bit] NULL,
CONSTRAINT [PK_incidencias] PRIMARY KEY CLUSTERED
(
[id_incidencia] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[convenios_anios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[convenios_anios](
[id_convenio_anio] [int] NOT NULL,
[id_convenio] [int] NULL,
[anio] [int] NULL,
[dias_vacaciones] [int] NULL,
[dias_matrimonio] [int] NULL,
CONSTRAINT [PK_convenios_anios] PRIMARY KEY CLUSTERED
(
[id_convenio_anio] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[flexibilidades]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[flexibilidades](
[id_flexibilidad] [int] NOT NULL,
[id_horario] [int] NULL,
[de_tipo] [int] NULL,
[a_tipo] [int] NULL,
[incluidas] [int] NULL,
[hasta] [nvarchar](5) NULL,
[incidencia] [nvarchar](5) NULL,
[todas_hasta] [bit] NULL,
[todas_incidencia] [bit] NULL,
CONSTRAINT [PK_flexibilidades] PRIMARY KEY CLUSTERED
(
[id_flexibilidad] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[franjas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[franjas](
[id_franja] [int] NOT NULL,
[id_horario] [int] NULL,
[inicio] [datetime] NULL,
[inicio_siguiente] [bit] NULL,
[fin] [datetime] NULL,
[fin_siguiente] [bit] NULL,
[margen_entrada] [nvarchar](5) NULL,
[margen_salida] [nvarchar](5) NULL,
[penalizacion1] [nvarchar](5) NULL,
[penalizacion2] [nvarchar](5) NULL,
[tipo] [int] NULL,
[obligada] [bit] NULL,
[minimo] [nvarchar](5) NULL,
[redondeo] [nvarchar](5) NULL,
[limite] [nvarchar](5) NULL,
[pausa] [nvarchar](1) NULL,
[pausa_inicio] [datetime] NULL,
[pausa_inicio_ds] [bit] NULL CONSTRAINT [DF_franjas_pausa_inicio_ds]
DEFAULT ((0)),
[pausa_fin] [datetime] NULL,
[pausa_fin_ds] [bit] NULL CONSTRAINT [DF_franjas_pausa_fin_ds]
DEFAULT ((0)),
[pausa_tipo] [int] NULL,
[pausa_tiempo] [nvarchar](5) NULL,
[pausa_minimo] [nvarchar](5) NULL,
[pausa_maximo] [nvarchar](5) NULL,
[pausa_pagada] [bit] NULL,
[pausa_np_infraccion] [nvarchar](5) NULL,
[pausa_min_contabilizar] [nvarchar](5) NULL,
[incidencias_por_defecto] [bit] NULL,
CONSTRAINT [PK_franjas] PRIMARY KEY CLUSTERED
(
[id_franja] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' ,
N'SCHEMA',N'dbo', N'TABLE',N'franjas', N'COLUMN',N'pausa'))
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Valores: S
= Sin pausa, M = Manual, A = Automática' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'franjas',
@level2type=N'COLUMN',@level2name=N'pausa'
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[horarios](
[id_horario] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[cambio_dia] [datetime] NULL,
[tiempo_obligado] [nvarchar](5) NULL,
[redondear_marcajes] [bit] NULL,
[redondear_incidencias] [bit] NULL,
[redondear_zonas] [bit] NULL,
[redondear_t_ent_redondeo] [int] NULL,
[redondear_t_ent_margen] [int] NULL,
[redondear_t_sal_redondeo] [int] NULL,
[redondear_t_sal_margen] [int] NULL,
[suplementos_aplicar] [bit] NULL,
[suplementos_antes] [bit] NULL,
[contabilizar_bloques] [bit] NULL,
[mi_obligado] [bit] NULL,
[minimo_presencia_tiempo] [nvarchar](5) NULL,
[minimo_presencia_tipo] [int] NULL,
[ausencia_sin_obligado] [bit] NULL,
[color] [int] NULL,
CONSTRAINT [PK_horarios] PRIMARY KEY CLUSTERED
(
[id_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[horarios_cambios_turno]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[horarios_cambios_turno](
[id_horario_cambio_turno] [int] NOT NULL,
[id_horario] [int] NULL,
[id_cambio_turno] [int] NOT NULL,
[ventana_inicio] [datetime] NULL,
[ventana_fin] [datetime] NULL,
[ventana_nocturno] [bit] NULL,
[incidencia_inicio] [datetime] NULL,
[incidencia_fin] [datetime] NULL,
[incidencia_nocturno] [bit] NULL,
CONSTRAINT [PK_horarios_cambios_turno] PRIMARY KEY CLUSTERED
(
[id_horario_cambio_turno] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_franjas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_franjas](
[id_incidencia_franja] [int] NOT NULL,
[id_franja] [int] NULL,
[tipo] [int] NULL,
[inicio] [datetime] NULL,
[inicio_ds] [bit] NULL,
[fin] [datetime] NULL,
[fin_ds] [bit] NULL,
[maximo] [nvarchar](5) NULL,
CONSTRAINT [PK_incidencias_franjas] PRIMARY KEY CLUSTERED
(
[id_incidencia_franja] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_horarios](
[id_incidencia_horario] [int] NOT NULL,
[id_horario] [int] NULL,
[tipo] [int] NULL,
[horas] [nvarchar](5) NULL,
[contar_dia] [nvarchar](5) NULL,
[contar_medio_dia] [nvarchar](5) NULL,
CONSTRAINT [PK_incidencias_horarios] PRIMARY KEY CLUSTERED
(
[id_incidencia_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_tipos_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_tipos_hora](
[id_incidencia_tipo_hora] [int] NOT NULL,
[id_incidencia] [int] NULL,
[id_tipo_hora] [int] NULL,
[permitido] [bit] NULL,
[pagado] [bit] NULL,
CONSTRAINT [PK_incidencias_tipos_hora] PRIMARY KEY CLUSTERED
(
[id_incidencia_tipo_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[marcajes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[marcajes](
[id_marcaje] [int] NOT NULL,
[id_personal] [int] NULL,
[fecha] [datetime] NULL,
[fin] [bit] NULL,
CONSTRAINT [PK_marcajes] PRIMARY KEY CLUSTERED
(
[id_marcaje] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[marcajes_automaticos]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[marcajes_automaticos](
[id_marcaje_automatico] [int] NOT NULL,
[id_horario] [int] NULL,
[hora] [datetime] NULL,
[incidencia] [int] NULL,
[ausencia] [bit] NULL,
CONSTRAINT [PK_marcajes_automaticos] PRIMARY KEY CLUSTERED
(
[id_marcaje_automatico] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pausas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pausas](
[id_pausa] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_pausas] PRIMARY KEY CLUSTERED
(
[id_pausa] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[personal]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[personal](
[id_personal] [int] NOT NULL,
[tarjeta] [int] NULL,
[nombre] [nvarchar](50) NULL,
[nif] [nvarchar](9) NULL,
[f_nacimiento] [datetime] NULL,
[sexo] [nchar](1) NULL,
[nass] [nvarchar](12) NULL,
[telefono] [nvarchar](50) NULL,
[domicilio] [nvarchar](50) NULL,
[poblacion] [nvarchar](50) NULL,
[cp] [int] NULL,
[provincia] [nvarchar](50) NULL,
[conyuge] [nvarchar](50) NULL,
[hijos] [int] NULL,
[banco] [nvarchar](50) NULL,
[cuenta] [nvarchar](20) NULL,
[id_categoria] [int] NULL,
[id_seccion] [int] NULL,
[id_grupo] [int] NULL,
[id_calendario] [int] NULL,
[id_calendario_fes] [int] NULL,
[baja] [bit] NULL,
[pagar_horas_acum] [bit] NULL,
[horas_pendientes] [nvarchar](6) NULL,
[horas_pendientes_n] [bit] NULL,
[observaciones] [text] NULL,
[foto] [image] NULL,
[codigo] [nvarchar] (20) NULL,
[centro_coste] [int] NULL,
CONSTRAINT [PK_personal] PRIMARY KEY CLUSTERED
(
[id_personal] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pluses]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pluses](
[id_plus] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_pluses] PRIMARY KEY CLUSTERED
(
[id_plus] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pluses_marcados]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pluses_marcados](
[id_plus_marcado] [int] NOT NULL,
[id_plus] [int] NULL,
[clase] [nvarchar](50) NULL,
[id_tabla] [int] NULL,
[coste] [money] NULL,
CONSTRAINT [PK_pluses_marcados] PRIMARY KEY CLUSTERED
(
[id_plus_marcado] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[redondeos]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[redondeos](
[id_redondeo] [int] NOT NULL,
[id_horario] [int] NULL,
[entrada_desde] [int] NULL,
[entrada_hasta] [int] NULL,
[entrada_redondeo] [int] NULL,
[salida_desde] [int] NULL,
[salida_hasta] [int] NULL,
[salida_redondeo] [int] NULL,
CONSTRAINT [PK_redondeos] PRIMARY KEY CLUSTERED
(
[id_redondeo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[suplementos_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[suplementos_horarios](
[id_suplemento_horario] [int] NOT NULL,
[id_horario] [int] NULL,
[tiempo] [nvarchar](5) NULL,
[id_tipo_hora] [int] NULL,
[sustituir] [bit] NULL,
CONSTRAINT [PK_suplementos_horarios] PRIMARY KEY CLUSTERED
(
[id_suplemento_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tiempo_tipo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tiempo_tipo](
[id_tiempo_tipo] [int] NOT NULL,
[clase] [nvarchar](50) NULL,
[id_tabla] [int] NULL,
[tiempo] [nvarchar](5) NULL,
[tipo] [int] NULL,
[activar] [bit] NULL,
CONSTRAINT [PK_tiempo_tipo] PRIMARY KEY CLUSTERED
(
[id_tiempo_tipo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tipos_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tipos_hora](
[id_tipos_hora] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[minimo] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_minimo]
DEFAULT ((0)),
[redondeo] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_redondeo]
DEFAULT ((0)),
[limite] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_limite]
DEFAULT ((0)),
[extra] [bit] NULL CONSTRAINT [DF_tipos_hora_extra] DEFAULT ('0'),
[saldo] [bit] NULL CONSTRAINT [DF_tipos_hora_saldo] DEFAULT ('0'),
[Compensa_inciden] [bit] NULL CONSTRAINT
[DF_tipos_hora_Compensa_inciden] DEFAULT ('0'),
[bolsa] [bit] NULL CONSTRAINT [DF_tipos_hora_bolsa] DEFAULT ('1'),
[Coeficiente_horas] [decimal](3, 2) NULL CONSTRAINT
[DF_tipos_hora_Coeficiente_horas] DEFAULT ((1)),
CONSTRAINT [PK_tipos_hora] PRIMARY KEY CLUSTERED
(
[id_tipos_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[variaciones_horas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[variaciones_horas](
[id_variacion_hora] [int] NOT NULL,
[id_personal] [int] NULL,
[fecha] [datetime] NULL,
[id_tipo_hora] [int] NULL,
[duracion] [datetime] NULL,
[dia_siguiente] [bit] NULL,
CONSTRAINT [PK_variaciones_horas] PRIMARY KEY CLUSTERED
(
[id_variacion_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[version]') AND type in (N'U'))
BEGIN
Falta código porque todo no entra
Gracias
Saludos
Tengo que pasar este código a sql 2000, pero me da montón de errores.
Existe algun depurador o "traductor" de SQL de SQL 2005 a SQl de SQL 2000
O que línea quito o como puedo saber cuales quitar.
Estos son los errores:
Servidor: mensaje 170, nivel 15, estado 1, línea 19
Línea 19: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 37
Línea 37: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 54
Línea 54: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 74
Línea 74: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 95
Línea 95: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 111
Línea 111: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 127
Línea 127: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 145
Línea 145: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 166
Línea 166: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 182
Línea 182: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 213
Línea 213: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 232
Línea 232: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 255
Línea 255: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 297
Línea 297: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 333
Línea 333: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 356
Línea 356: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 378
Línea 378: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 398
Línea 398: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 417
Línea 417: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 435
Línea 435: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 454
Línea 454: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 470
Línea 470: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 513
Línea 513: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 529
Línea 529: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 548
Línea 548: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 570
Línea 570: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 589
Línea 589: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 609
Línea 609: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 633
Línea 633: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 653
Línea 653: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 681
Línea 681: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 700
Línea 700: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 720
Línea 720: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 737
Línea 737: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 754
Línea 754: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 772
Línea 772: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 790
Línea 790: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 806
Línea 806: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 824
Línea 824: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 840
Línea 840: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 857
Línea 857: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 876
Línea 876: sintaxis incorrecta cerca de '('.
Servidor: mensaje 170, nivel 15, estado 1, línea 886
Línea 886: sintaxis incorrecta cerca de '('.
Y este el código:
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE DATABASE galipres;
USE galipres
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[inf_archivo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[inf_archivo](
[tipo] [nvarchar](50) NOT NULL,
[fecha] [datetime] NOT NULL,
[descripcion] [nvarchar](100) NOT NULL,
[informe] [text] NOT NULL,
CONSTRAINT [PK_inf_archivo] PRIMARY KEY CLUSTERED
(
[tipo] ASC,
[fecha] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[calendarios_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[calendarios_horarios](
[id_calendarios_horarios] [int] NOT NULL,
[id_calendario] [int] NULL,
[anio] [int] NULL,
[horarios] [text] NULL,
CONSTRAINT [PK_calendarios_horarios] PRIMARY KEY CLUSTERED
(
[id_calendarios_horarios] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[sel_personal]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[sel_personal](
[id_sel_personal] [int] NOT NULL,
[nombre] [varchar](50) NULL,
[codigos] [text] NULL,
CONSTRAINT [PK_sel_personal] PRIMARY KEY CLUSTERED
(
[id_sel_personal] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[cambios_turno]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[cambios_turno](
[id_cambio_turno] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[ventanas_incidencia] [bit] NULL,
[tiempo_min_marcajes] [nvarchar](5) NULL,
[tiempo_max_turno] [nvarchar](5) NULL,
[color] [int] NULL,
CONSTRAINT [PK_cambios_turno] PRIMARY KEY CLUSTERED
(
[id_cambio_turno] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[fichajes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[fichajes](
[id_fichajes] [int] NOT NULL,
[tarjeta] [int] NULL,
[fecha] [datetime] NULL,
[id_incidencia] [int] NULL,
[baja] [bit] NULL,
[terminal] [nvarchar] (20) NULL,
[manual] [bit] NULL,
CONSTRAINT [PK_fichajes] PRIMARY KEY CLUSTERED
(
[id_fichajes] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[categorias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[categorias](
[id_categoria] [int] NOT NULL,
[nombre] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_categorias] PRIMARY KEY CLUSTERED
(
[id_categoria] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tipos_incidencias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tipos_incidencias](
[id_tipos_incidencias] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_tipos_incidencias] PRIMARY KEY CLUSTERED
(
[id_tipos_incidencias] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[Categorias_Coste_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Categorias_Coste_hora](
[id_categoria_coste_hora] [int] NOT NULL,
[id_categoria] [int] NULL,
[id_tipo_hora] [int] NULL,
[coste_hora] [money] NULL,
CONSTRAINT [PK_Categorias_Coste_hora] PRIMARY KEY CLUSTERED
(
[id_categoria_coste_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[variaciones]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[variaciones](
[id_variaciones] [int] NOT NULL,
[id_personal] [int] NULL,
[desde] [datetime] NULL,
[hasta] [datetime] NULL,
[concepto] [int] NULL,
[id_concepto] [int] NULL,
[observaciones] [text] NULL,
CONSTRAINT [PK_variaciones] PRIMARY KEY CLUSTERED
(
[id_variaciones] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[convenios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[convenios](
[id_convenio] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_convenios] PRIMARY KEY CLUSTERED
(
[id_convenio] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias](
[id_incidencia] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[clave_informes] [nvarchar](7) NULL,
[varios_dias] [bit] NULL,
[permitida_festivos] [bit] NULL,
[tipo] [int] NULL,
[contar_dias] [bit] NULL,
[contar_medios_dias] [bit] NULL,
[contar_horas] [bit] NULL,
[maximo_diario] [nvarchar](5) NULL,
[compensar_horas] [bit] NULL,
[pagada_pres_corregida] [bit] NULL,
[redondear_marcajes] [bit] NULL,
[tiempo_contabilizado] [int] NULL,
[tipo_hora_tc] [int] NULL,
[maximo_anual] [int] NULL,
[sin_absentismo] [bit] NULL,
CONSTRAINT [PK_incidencias] PRIMARY KEY CLUSTERED
(
[id_incidencia] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[convenios_anios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[convenios_anios](
[id_convenio_anio] [int] NOT NULL,
[id_convenio] [int] NULL,
[anio] [int] NULL,
[dias_vacaciones] [int] NULL,
[dias_matrimonio] [int] NULL,
CONSTRAINT [PK_convenios_anios] PRIMARY KEY CLUSTERED
(
[id_convenio_anio] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[flexibilidades]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[flexibilidades](
[id_flexibilidad] [int] NOT NULL,
[id_horario] [int] NULL,
[de_tipo] [int] NULL,
[a_tipo] [int] NULL,
[incluidas] [int] NULL,
[hasta] [nvarchar](5) NULL,
[incidencia] [nvarchar](5) NULL,
[todas_hasta] [bit] NULL,
[todas_incidencia] [bit] NULL,
CONSTRAINT [PK_flexibilidades] PRIMARY KEY CLUSTERED
(
[id_flexibilidad] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[franjas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[franjas](
[id_franja] [int] NOT NULL,
[id_horario] [int] NULL,
[inicio] [datetime] NULL,
[inicio_siguiente] [bit] NULL,
[fin] [datetime] NULL,
[fin_siguiente] [bit] NULL,
[margen_entrada] [nvarchar](5) NULL,
[margen_salida] [nvarchar](5) NULL,
[penalizacion1] [nvarchar](5) NULL,
[penalizacion2] [nvarchar](5) NULL,
[tipo] [int] NULL,
[obligada] [bit] NULL,
[minimo] [nvarchar](5) NULL,
[redondeo] [nvarchar](5) NULL,
[limite] [nvarchar](5) NULL,
[pausa] [nvarchar](1) NULL,
[pausa_inicio] [datetime] NULL,
[pausa_inicio_ds] [bit] NULL CONSTRAINT [DF_franjas_pausa_inicio_ds]
DEFAULT ((0)),
[pausa_fin] [datetime] NULL,
[pausa_fin_ds] [bit] NULL CONSTRAINT [DF_franjas_pausa_fin_ds]
DEFAULT ((0)),
[pausa_tipo] [int] NULL,
[pausa_tiempo] [nvarchar](5) NULL,
[pausa_minimo] [nvarchar](5) NULL,
[pausa_maximo] [nvarchar](5) NULL,
[pausa_pagada] [bit] NULL,
[pausa_np_infraccion] [nvarchar](5) NULL,
[pausa_min_contabilizar] [nvarchar](5) NULL,
[incidencias_por_defecto] [bit] NULL,
CONSTRAINT [PK_franjas] PRIMARY KEY CLUSTERED
(
[id_franja] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
IF NOT EXISTS (SELECT * FROM ::fn_listextendedproperty(N'MS_Description' ,
N'SCHEMA',N'dbo', N'TABLE',N'franjas', N'COLUMN',N'pausa'))
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Valores: S
= Sin pausa, M = Manual, A = Automática' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'franjas',
@level2type=N'COLUMN',@level2name=N'pausa'
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[horarios](
[id_horario] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[cambio_dia] [datetime] NULL,
[tiempo_obligado] [nvarchar](5) NULL,
[redondear_marcajes] [bit] NULL,
[redondear_incidencias] [bit] NULL,
[redondear_zonas] [bit] NULL,
[redondear_t_ent_redondeo] [int] NULL,
[redondear_t_ent_margen] [int] NULL,
[redondear_t_sal_redondeo] [int] NULL,
[redondear_t_sal_margen] [int] NULL,
[suplementos_aplicar] [bit] NULL,
[suplementos_antes] [bit] NULL,
[contabilizar_bloques] [bit] NULL,
[mi_obligado] [bit] NULL,
[minimo_presencia_tiempo] [nvarchar](5) NULL,
[minimo_presencia_tipo] [int] NULL,
[ausencia_sin_obligado] [bit] NULL,
[color] [int] NULL,
CONSTRAINT [PK_horarios] PRIMARY KEY CLUSTERED
(
[id_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[horarios_cambios_turno]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[horarios_cambios_turno](
[id_horario_cambio_turno] [int] NOT NULL,
[id_horario] [int] NULL,
[id_cambio_turno] [int] NOT NULL,
[ventana_inicio] [datetime] NULL,
[ventana_fin] [datetime] NULL,
[ventana_nocturno] [bit] NULL,
[incidencia_inicio] [datetime] NULL,
[incidencia_fin] [datetime] NULL,
[incidencia_nocturno] [bit] NULL,
CONSTRAINT [PK_horarios_cambios_turno] PRIMARY KEY CLUSTERED
(
[id_horario_cambio_turno] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_franjas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_franjas](
[id_incidencia_franja] [int] NOT NULL,
[id_franja] [int] NULL,
[tipo] [int] NULL,
[inicio] [datetime] NULL,
[inicio_ds] [bit] NULL,
[fin] [datetime] NULL,
[fin_ds] [bit] NULL,
[maximo] [nvarchar](5) NULL,
CONSTRAINT [PK_incidencias_franjas] PRIMARY KEY CLUSTERED
(
[id_incidencia_franja] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_horarios](
[id_incidencia_horario] [int] NOT NULL,
[id_horario] [int] NULL,
[tipo] [int] NULL,
[horas] [nvarchar](5) NULL,
[contar_dia] [nvarchar](5) NULL,
[contar_medio_dia] [nvarchar](5) NULL,
CONSTRAINT [PK_incidencias_horarios] PRIMARY KEY CLUSTERED
(
[id_incidencia_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[incidencias_tipos_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[incidencias_tipos_hora](
[id_incidencia_tipo_hora] [int] NOT NULL,
[id_incidencia] [int] NULL,
[id_tipo_hora] [int] NULL,
[permitido] [bit] NULL,
[pagado] [bit] NULL,
CONSTRAINT [PK_incidencias_tipos_hora] PRIMARY KEY CLUSTERED
(
[id_incidencia_tipo_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[marcajes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[marcajes](
[id_marcaje] [int] NOT NULL,
[id_personal] [int] NULL,
[fecha] [datetime] NULL,
[fin] [bit] NULL,
CONSTRAINT [PK_marcajes] PRIMARY KEY CLUSTERED
(
[id_marcaje] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[marcajes_automaticos]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[marcajes_automaticos](
[id_marcaje_automatico] [int] NOT NULL,
[id_horario] [int] NULL,
[hora] [datetime] NULL,
[incidencia] [int] NULL,
[ausencia] [bit] NULL,
CONSTRAINT [PK_marcajes_automaticos] PRIMARY KEY CLUSTERED
(
[id_marcaje_automatico] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pausas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pausas](
[id_pausa] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_pausas] PRIMARY KEY CLUSTERED
(
[id_pausa] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[personal]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[personal](
[id_personal] [int] NOT NULL,
[tarjeta] [int] NULL,
[nombre] [nvarchar](50) NULL,
[nif] [nvarchar](9) NULL,
[f_nacimiento] [datetime] NULL,
[sexo] [nchar](1) NULL,
[nass] [nvarchar](12) NULL,
[telefono] [nvarchar](50) NULL,
[domicilio] [nvarchar](50) NULL,
[poblacion] [nvarchar](50) NULL,
[cp] [int] NULL,
[provincia] [nvarchar](50) NULL,
[conyuge] [nvarchar](50) NULL,
[hijos] [int] NULL,
[banco] [nvarchar](50) NULL,
[cuenta] [nvarchar](20) NULL,
[id_categoria] [int] NULL,
[id_seccion] [int] NULL,
[id_grupo] [int] NULL,
[id_calendario] [int] NULL,
[id_calendario_fes] [int] NULL,
[baja] [bit] NULL,
[pagar_horas_acum] [bit] NULL,
[horas_pendientes] [nvarchar](6) NULL,
[horas_pendientes_n] [bit] NULL,
[observaciones] [text] NULL,
[foto] [image] NULL,
[codigo] [nvarchar] (20) NULL,
[centro_coste] [int] NULL,
CONSTRAINT [PK_personal] PRIMARY KEY CLUSTERED
(
[id_personal] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pluses]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pluses](
[id_plus] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
CONSTRAINT [PK_pluses] PRIMARY KEY CLUSTERED
(
[id_plus] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[pluses_marcados]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[pluses_marcados](
[id_plus_marcado] [int] NOT NULL,
[id_plus] [int] NULL,
[clase] [nvarchar](50) NULL,
[id_tabla] [int] NULL,
[coste] [money] NULL,
CONSTRAINT [PK_pluses_marcados] PRIMARY KEY CLUSTERED
(
[id_plus_marcado] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[redondeos]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[redondeos](
[id_redondeo] [int] NOT NULL,
[id_horario] [int] NULL,
[entrada_desde] [int] NULL,
[entrada_hasta] [int] NULL,
[entrada_redondeo] [int] NULL,
[salida_desde] [int] NULL,
[salida_hasta] [int] NULL,
[salida_redondeo] [int] NULL,
CONSTRAINT [PK_redondeos] PRIMARY KEY CLUSTERED
(
[id_redondeo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[suplementos_horarios]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[suplementos_horarios](
[id_suplemento_horario] [int] NOT NULL,
[id_horario] [int] NULL,
[tiempo] [nvarchar](5) NULL,
[id_tipo_hora] [int] NULL,
[sustituir] [bit] NULL,
CONSTRAINT [PK_suplementos_horarios] PRIMARY KEY CLUSTERED
(
[id_suplemento_horario] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tiempo_tipo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tiempo_tipo](
[id_tiempo_tipo] [int] NOT NULL,
[clase] [nvarchar](50) NULL,
[id_tabla] [int] NULL,
[tiempo] [nvarchar](5) NULL,
[tipo] [int] NULL,
[activar] [bit] NULL,
CONSTRAINT [PK_tiempo_tipo] PRIMARY KEY CLUSTERED
(
[id_tiempo_tipo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[tipos_hora]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tipos_hora](
[id_tipos_hora] [int] NOT NULL,
[nombre] [nvarchar](50) NULL,
[minimo] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_minimo]
DEFAULT ((0)),
[redondeo] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_redondeo]
DEFAULT ((0)),
[limite] [nvarchar](5) NULL CONSTRAINT [DF_tipos_hora_limite]
DEFAULT ((0)),
[extra] [bit] NULL CONSTRAINT [DF_tipos_hora_extra] DEFAULT ('0'),
[saldo] [bit] NULL CONSTRAINT [DF_tipos_hora_saldo] DEFAULT ('0'),
[Compensa_inciden] [bit] NULL CONSTRAINT
[DF_tipos_hora_Compensa_inciden] DEFAULT ('0'),
[bolsa] [bit] NULL CONSTRAINT [DF_tipos_hora_bolsa] DEFAULT ('1'),
[Coeficiente_horas] [decimal](3, 2) NULL CONSTRAINT
[DF_tipos_hora_Coeficiente_horas] DEFAULT ((1)),
CONSTRAINT [PK_tipos_hora] PRIMARY KEY CLUSTERED
(
[id_tipos_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[variaciones_horas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[variaciones_horas](
[id_variacion_hora] [int] NOT NULL,
[id_personal] [int] NULL,
[fecha] [datetime] NULL,
[id_tipo_hora] [int] NULL,
[duracion] [datetime] NULL,
[dia_siguiente] [bit] NULL,
CONSTRAINT [PK_variaciones_horas] PRIMARY KEY CLUSTERED
(
[id_variacion_hora] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id =
OBJECT_ID(N'[dbo].[version]') AND type in (N'U'))
BEGIN
Falta código porque todo no entra
Gracias
Saludos
Leer las respuestas