Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5...

78

Transcript of Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5...

Page 1: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo
Page 2: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 2

INDICE Capitulos Página

1. Estructura física de BACEQ 3 2. Información del modelo 8 3. Lista de Tablas de la base de datos 8 4. Lista de campos de cada tabla 9

4.1 AccesosUsuarios 9 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo 20 4.11 FisicoQuimico 29 4.12 Genero 30 4.13 HeliceDetalle 31 4.14 HeliceEncabezado 33 4.15 Invertebrados 34 4.16 Lluvia 35 4.17 Lluvia24 36 4.18 Margenes 37 4.19 Morfologia_Caudal 38 4.20 Morfologia_Regleta 40 4.21 Morfologia_Topografia 42 4.22 Nubocidad 45 4.23 Observadores 46 4.24 ObservadoresCampana 47 4.25 Orden 48 4.26 Parametros 49 4.27 Phylum 50 4.28 Plantillas 51 4.29 Profundidad 52 4.30 Programas 53 4.31 Protocolos 54 4.32 Publicaciones 55 4.33 PuntajeHabitat 57 4.34 Quimicos 59 4.35 Rios 60 4.36 Rivera 61 4.37 SubCuenca 62 4.38 SubClase 63 4.39 Surbers 65 4.40 Sustrato 68 4.41 Taxa 69 4.42 TipoCampana 71 4.43 Turbidez 72 4.44 Turbulencia 73 4.45 Unidades 74 4.46 Usuarios 75 4.47 Vegetacion 76 4.48 Viento 77

Page 3: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 3

1. Estructura física de BACEQ

Page 4: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 4

Page 5: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 5

Page 6: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 6

Page 7: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 7

Page 8: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 8

2. Información del modelo

Nombre: BACEQ Versión: 1.0 Base de datos: Microsoft SQL Server 2000 Front End: Microsoft Visual Studio El presente manual hará referencia a la base de datos Microsoft SQL Server 2000 ya que en esta base se han subido los datos para este proyecto. Es posible usar cualquier base de datos ya sea MySql, Acces, Oracle, etc. Simplemente habría que hacer pequeños cambios en los enlaces desde el programa.

3. Lista de Tablas de la base de datos

Nombre Tabla Descripción AccesosUsuarios Accesos de los usuarios del sistema

AguasAbiertas Lista de opciones para aguas abiertas

Ancho Lista de opciones para ancho

Campana Datos generales de campañas

Clase Clases de los invertebrados

Cuenca Cuencas Hidrográficas

Estacion Estaciones

Facies Lista de opciones para facies

Familia Familias de los invertebrados

FichaCampo Fichas de campo

FisicoQuimico Análisis físico-químico de las fichas de campo

Genero Géneros de los invertebrados

HeliceDetalle Vueltas de las hélices y sus respectivas velocidades

HeliceEncabezado Datos generales de las hélices

Invertebrados Invertebrados

Lluvia Lista de opciones para lluvia

Lluvia24 Lista de opciones para lluvia ultimas 24 horas

Margenes Lista de opciones para márgenes

Morfologia_Caudal Datos de caudales en las fichas de morfología

Morfologia_Regleta Datos de la regleta en las fichas de morfología

Morfologia_Topografia Datos de topografía en las fichas de morfología

Nubocidad Lista de opciones para la nubosidad

Observadores Datos generales de participantes para las campañas

ObservadoresCampana Observadores por campañas

Orden Ordenes de los invertebrados

Parametros Parámetros generales del sistema

Phylum Phylums de los invertebrados

Plantillas Documentos de plantillas

Profundidad Lista de opciones para la profundidad del río

Programas Programas que se usan para la edición de documentos

Protocolos Documentos de protocolos

Publicaciones Documentos de publicaciones

PuntajeHabitat Lista de opciones para los puntajes de hábitat

Page 9: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 9

Quimicos Datos generales de químicos

Rios Ríos de las estaciones

Rivera Lista de opciones de ubicación de los surber

Subclase Subclases de los invertebrados

SubCuenca Sub-Cuencas de las estaciones

Surbers Datos de los Surber de las fichas de campo

Sustrato Lista de opciones para sustrato

Taxa Datos de Taxa de las fichas de campo

TipoCampana Lista de opciones de tipos de campaña

Turbidez Lista de opciones para turbidez

Turbulencia Lista de opciones para turbulencia

Unidades Lista de opciones para unidades

Usuarios Datos generales de los usuarios del sistema

Vegetacion Lista de opciones de vegetación

Viento Lista de opciones de viento

4. Lista de campos de cada tabla

4.1 AccesosUsuarios

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

usr_Codigo character 20 No acc_Codigo character 10 No acc_Nombre character 60 Si acc_Texto character 60 Si acc_Activo bit 1 Si acc_Ejecuta bit 1 Si

Primary Key

- Usr_Codigo - Acc_Codigo Dependencias Objetos que dependen de AccesosUsuarios:

Objetos de los que depende AccesosUsuarios: - Usuarios

Código de creación alter table ACCESOSUSUARIOS drop constraint FK_AccesosUsuarios go if exists (select 1 from sysindexes where id = object_id('ACCESOSUSUARIOS') and name = 'ACC_CODIGO'

Page 10: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 10

and indid > 0 and indid < 255) drop index ACCESOSUSUARIOS.ACC_CODIGO go if exists (select 1 from sysobjects where id = object_id('ACCESOSUSUARIOS') and type = 'U') drop table ACCESOSUSUARIOS go /*==============================================================*/ /* Table: ACCESOSUSUARIOS */ /*==============================================================*/ create table ACCESOSUSUARIOS ( USR_CODIGO character(20) not null, ACC_CODIGO character(10) not null, ACC_NOMBRE character(60) null, ACC_TEXTO character(60) null, ACC_ACTIVO bit null, ACC_EJECUTA bit null, constraint PK_ACCESOSUSUARIOS primary key (USR_CODIGO, ACC_CODIGO)) go /*==============================================================*/ /* Index: ACC_CODIGO */ /*==============================================================*/ create unique index ACC_CODIGO on ACCESOSUSUARIOS (USR_CODIGO, ACC_CODIGO) go alter table ACCESOSUSUARIOS add constraint FK_AccesosUsuarios foreign key (USR_CODIGO) references USUARIOS (USR_CODIGO) go

4.2 AguasAbiertas

Nombre de

columna Tipo de datos Longitud

Permitir valores nulos

agu_Codigo Numeric 1 No agu_Nombre character 20 Si

Primary Key

- agu_Codigo Dependencias Objetos que dependen de AguasAbiertas:

Objetos de los que depende AguasAbiertas: - FichaCampo

Page 11: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 11

Código de creación alter table FICHACAMPO drop constraint FK_FichasAguasAbiertas go if exists (select 1 from sysindexes where id = object_id('AGUASABIERTAS') and name = 'AGU_CODIGO' and indid > 0 and indid < 255) drop index AGUASABIERTAS.AGU_CODIGO go if exists (select 1 from sysobjects where id = object_id('AGUASABIERTAS') and type = 'U') drop table AGUASABIERTAS go /*==============================================================*/ /* Table: AGUASABIERTAS */ /*==============================================================*/ create table AGUASABIERTAS ( AGU_CODIGO numeric(1) not null, AGU_NOMBRE character(10) null, constraint PK_AGUASABIERTAS primary key (AGU_CODIGO)) go /*==============================================================*/ /* Index: AGU_CODIGO */ /*==============================================================*/ create unique index AGU_CODIGO on AGUASABIERTAS (AGU_CODIGO) go

4.3 Ancho

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

anc_Codigo Numeric 1 No anc_Nombre character 20 Si

Primary Key

- anc_Codigo Dependencias Objetos que dependen de Ancho:

Objetos de los que depende Ancho: - FichaCampo

Page 12: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 12

Código de creación alter table FICHACAMPO drop constraint FK_FichaAncho go if exists (select 1 from sysindexes where id = object_id('ANCHO') and name = 'ANC_CODIGO' and indid > 0 and indid < 255) drop index ANCHO.ANC_CODIGO go if exists (select 1 from sysobjects where id = object_id('ANCHO') and type = 'U') drop table ANCHO go /*==============================================================*/ /* Table: ANCHO */ /*==============================================================*/ create table ANCHO ( ANC_CODIGO numeric(1) not null, ANC_NOMBRE character(10) null, constraint PK_ANCHO primary key (ANC_CODIGO)) go /*==============================================================*/ /* Index: ANC_CODIGO */ /*==============================================================*/ create unique index ANC_CODIGO on ANCHO (ANC_CODIGO) go

4.4 Campana

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No cam_FechaIni Datetime 8 Si cam_FechaFin Datetime 8 Si cam_Participantes Carácter 100 Si cam_Estaciones Numeric 3 Si cam_MuestrasS Numeric 3 Si cam_MuestrasRM Numeric 3 Si cam_Observaciones Text 16 Si

Page 13: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 13

Primary Key - tip_Codigo - cam_Numero Dependencias Objetos que dependen de Campana: - FichaCampo - MorfologiaRegleta - ObservadoresCampana

Objetos de los que depende Campana: - TipoCampana

Código de creación

alter table CAMPANA drop constraint FK_CampanaTipo go alter table FICHACAMPO drop constraint FK_FichasCampana go alter table OBSERVADORESCAMPANA drop constraint FK_Campana go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaCampana go if exists (select 1 from sysindexes where id = object_id('CAMPANA') and name = 'CAM_NUMERO' and indid > 0 and indid < 255) drop index CAMPANA.CAM_NUMERO go if exists (select 1 from sysobjects where id = object_id('CAMPANA') and type = 'U') drop table CAMPANA go /*==============================================================*/ /* Table: CAMPANA */ /*==============================================================*/ create table CAMPANA ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, CAM_FECHAINI datetime null, CAM_FECHAFIN datetime null, CAM_PARTICIPANTES character(100) null, CAM_ESTACIONES numeric(3) null,

Page 14: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 14

CAM_MUESTRASS numeric(3) null, CAM_MUESTRASRM numeric(3) null, CAM_OBSERVACIONES text null, constraint PK_CAMPANA primary key (TIP_CODIGO, CAM_NUMERO)) go /*==============================================================*/ /* Index: CAM_NUMERO */ /*==============================================================*/ create unique index CAM_NUMERO on CAMPANA (TIP_CODIGO, CAM_NUMERO) go alter table CAMPANA add constraint FK_CampanaTipo foreign key (TIP_CODIGO) references TIPOCAMPANA (TIP_CODIGO) go

4.5 Clase

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

cla_Codigo Numeric 3 No phy_Codigo Numeric 3 No cla_Nombre character 20 Si

Primary Key

- cla_Codigo Dependencias Objetos que dependen de Clase: - SubClase

Objetos de los que depende Clase: - Phylum

Código de creación

alter table CLASE drop constraint FK_PhylumClase go alter table SUBCLASE drop constraint FK_ClaseSubc go if exists (select 1 from sysindexes where id = object_id('CLASE') and name = 'CLA_CODIGO' and indid > 0 and indid < 255) drop index CLASE.CLA_CODIGO go if exists (select 1

Page 15: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 15

from sysobjects where id = object_id('CLASE') and type = 'U') drop table CLASE go /*==============================================================*/ /* Table: CLASE */ /*==============================================================*/ create table CLASE ( CLA_CODIGO numeric(3) not null, PHY_CODIGO numeric(3) null, CLA_NOMBRE character(20) null, constraint PK_CLASE primary key (CLA_CODIGO)) go /*==============================================================*/ /* Index: CLA_CODIGO */ /*==============================================================*/ create unique index CLA_CODIGO on CLASE (CLA_CODIGO) go alter table CLASE add constraint FK_PhylumClase foreign key (PHY_CODIGO) references PHYLUM (PHY_CODIGO) go

4.6 Cuenca

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

cue_Codigo Character 2 No cue_Nombre Character 30 Si

Primary Key

- cla_Codigo Dependencias Objetos que dependen de Cuenca: - SubCuenca

Objetos de los que depende Cuenca:

Código de creación

alter table SUBCUENCA drop constraint FK_SubcuencasCuenca go if exists (select 1 from sysindexes where id = object_id('CUENCA') and name = 'CUE_CODIGO' and indid > 0 and indid < 255)

Page 16: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 16

drop index CUENCA.CUE_CODIGO go if exists (select 1 from sysobjects where id = object_id('CUENCA') and type = 'U') drop table CUENCA go /*==============================================================*/ /* Table: CUENCA */ /*==============================================================*/ create table CUENCA ( CUE_CODIGO character(2) not null, CUE_NOMBRE character(30) null, constraint PK_CUENCA primary key (CUE_CODIGO)) go /*==============================================================*/ /* Index: CUE_CODIGO */ /*==============================================================*/ create unique index CUE_CODIGO on CUENCA (CUE_CODIGO) go

4.7 Estacion

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

est_Codigo Character 4 No rio_Codigo Character 2 No est_Nombre Character 30 Si est_Longitud Character 10 Si est_Latitud Character 10 Si est_Altura Numeric 4 Si est_Foto Imagen 16 Si est_Comentario Texto 16 Si est_SupCuenca Numeric 5 Si est_Exutorio Numeric 5 Si

Primary Key

- est_Codigo Dependencias Objetos que dependen de Estacion: - FichaCampo - Morfologia_Regleta

Objetos de los que depende Estacion: - Rios

Page 17: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 17

Código de creación

alter table ESTACION drop constraint FK_EstacionesRio go alter table FICHACAMPO drop constraint FK_CampanaEstacion go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaEstacion go if exists (select 1 from sysindexes where id = object_id('ESTACION') and name = 'EST_CODIGO' and indid > 0 and indid < 255) drop index ESTACION.EST_CODIGO go if exists (select 1 from sysobjects where id = object_id('ESTACION') and type = 'U') drop table ESTACION go /*==============================================================*/ /* Table: ESTACION */ /*==============================================================*/ create table ESTACION ( EST_CODIGO character(4) not null, RIO_CODIGO character(2) null, EST_NOMBRE character(30) null, EST_LONGITUD character(10) null, EST_LATITUD character(10) null, EST_ALTURA numeric(4) null, EST_FOTO image null, EST_COMENTARIO text null, EST_SUPCUENCA numeric(5) null, EST_EXUTORIO numeric(5) null, constraint PK_ESTACION primary key (EST_CODIGO)) go /*==============================================================*/ /* Index: EST_CODIGO */ /*==============================================================*/ create unique index EST_CODIGO on ESTACION (EST_CODIGO) go alter table ESTACION add constraint FK_EstacionesRio foreign key (RIO_CODIGO) references RIOS (RIO_CODIGO) go

Page 18: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 18

4.8 Facies

Nombre de

columna Tipo de datos Longitud

Permitir valores nulos

fac_Codigo Numeric 1 No fac_Nombre Character 10 Si

Primary Key

- fac_Codigo Dependencias Objetos que dependen de Facies: - Surbers

Objetos de los que depende Facies:

Código de creación

alter table SURBERS drop constraint FK_SurberFacies go if exists (select 1 from sysindexes where id = object_id('FACIES') and name = 'FAC_CODIGO' and indid > 0 and indid < 255) drop index FACIES.FAC_CODIGO go if exists (select 1 from sysobjects where id = object_id('FACIES') and type = 'U') drop table FACIES go /*==============================================================*/ /* Table: FACIES */ /*==============================================================*/ create table FACIES ( FAC_CODIGO numeric(1) not null, FAC_NOMBRE character(10) null, constraint PK_FACIES primary key (FAC_CODIGO)) go /*==============================================================*/ /* Index: FAC_CODIGO */ /*==============================================================*/ create unique index FAC_CODIGO on FACIES (FAC_CODIGO) go

Page 19: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 19

4.9 Familia

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

fam_Codigo Numeric 3 No ord_Codigo Numeric 3 No fam_Nombre Character 20 Si

Primary Key

- fam_Codigo Dependencias Objetos que dependen de Familia: - Genero

Objetos de los que depende Familia: - Orden

Código de creación

alter table FAMILIA drop constraint FK_OrdenFamilia go alter table GENERO drop constraint FK_FamiliaGenero go if exists (select 1 from sysindexes where id = object_id('FAMILIA') and name = 'FAM_CODIGO' and indid > 0 and indid < 255) drop index FAMILIA.FAM_CODIGO go if exists (select 1 from sysobjects where id = object_id('FAMILIA') and type = 'U') drop table FAMILIA go /*==============================================================*/ /* Table: FAMILIA */ /*==============================================================*/ create table FAMILIA ( FAM_CODIGO numeric(3) not null, ORD_CODIGO numeric(3) null, FAM_NOMBRE character(20) null, constraint PK_FAMILIA primary key (FAM_CODIGO)) go /*==============================================================*/ /* Index: FAM_CODIGO */

Page 20: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 20

/*==============================================================*/ create unique index FAM_CODIGO on FAMILIA (FAM_CODIGO) go alter table FAMILIA add constraint FK_OrdenFamilia foreign key (ORD_CODIGO) references ORDEN (ORD_CODIGO) go

4.10 FichaCampo

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No fic_Numero Numeric 5 No fic_Fecha Datetime 8 Si obs_Codigo Numeric 2 No llu_Codigo Numeric 1 No l24_Codigo Numeric 1 No nub_Codigo Numeric 1 No vie_Codigo Numeric 1 No anc_Codigo Numeric 1 No pro_Codigo Numeric 1 No tur_Codigo Numeric 1 No trb_Codigo Numeric 1 No fic_SiNoColor bit 1 Si fic_Color Character 20 No fic_SiNoOlor Bit 1 Si fic_Olor Character 20 No fic_Regleta Numeric 3 Si agu_Codigo Numeric 1 No fic_AguasAbiertas Character 20 Si mar_Codigo Numeric 1 No fic_Margenes Character 20 Si fic_Conductividad Numeric 6,2 Si fic_PH Numeric 6,2 Si fic_Temperatura Numeric 6,2 Si fic_Oxigeno Numeric 6,2 Si f1_Codigo Numeric 1 No f2_Codigo Numeric 1 No f3_Codigo Numeric 1 No f4_Codigo Numeric 1 No f5_Codigo Numeric 1 No v1_Codigo Numeric 1 No v2_Codigo Numeric 1 No v3_Codigo Numeric 1 No v4_Codigo Numeric 1 No

Page 21: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 21

v5_Codigo Numeric 1 No g1_Codigo Numeric 1 No g2_Codigo Numeric 1 No g3_Codigo Numeric 1 No g4_Codigo Numeric 1 No g5_Codigo Numeric 1 No g6_Codigo Numeric 1 No g7_Codigo Numeric 1 No est_Codigo Character 4 No fic_FrascosSurbers Numeric 3 Si fic_FrascosRM Numeric 3 Si h1f_Codigo Numeric 1 No h1v_Codigo Numeric 1 No h1s_Codigo Numeric 1 No h2f_Codigo Numeric 1 No h2v_Codigo Numeric 1 No h2s_Codigo Numeric 1 No h3f_Codigo Numeric 1 No h3v_Codigo Numeric 1 No h3s_Codigo Numeric 1 No h4f_Codigo Numeric 1 No h4v_Codigo Numeric 1 No h4s_Codigo Numeric 1 No h5f_Codigo Numeric 1 No h5v_Codigo Numeric 1 No h5s_Codigo Numeric 1 No h6f_Codigo Numeric 1 No h6v_Codigo Numeric 1 No h6s_Codigo Numeric 1 No fic_Archivo Character 100 Si prg_Codigo Character 20 No hel_Codigo Numeric 2 No fic_Comentario Texto 16 Si

Primary Key

- fam_Codigo Dependencias Objetos que dependen de FichaCampo: - tip_Codigo - cam_Numero - fic_Numero

Objetos de los que depende FichaCampo: - AguasAbiertas - Ancho - Campana - Estacion - HeliceEncabezado

Page 22: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 22

- Lluvia - Lluvia24 - Margenes - Nubocidad - Observadores - Profundidad - Programas - PuntajeHabitat - Turbidez - Turbulencia - Viento

Código de creación

alter table FICHACAMPO drop constraint "FK_Campana-Nubocidad" go alter table FICHACAMPO drop constraint "FK_Campana-Lluvia" go alter table FICHACAMPO drop constraint "FK_Campana-Viento" go alter table FICHACAMPO drop constraint "FK_Campana-Lluvia24" go alter table FICHACAMPO drop constraint FK_ObservadorFicha go alter table FICHACAMPO drop constraint FK_FichaAncho go alter table FICHACAMPO drop constraint FK_FichaProfundidad go alter table FICHACAMPO drop constraint FK_FichaTurbulencia go alter table FICHACAMPO drop constraint FK_FichaTurbidez go alter table FICHACAMPO drop constraint FK_FichasAguasAbiertas go alter table FICHACAMPO drop constraint FK_FichasMargenes go

Page 23: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 23

alter table FICHACAMPO drop constraint FK_FichaF1 go alter table FICHACAMPO drop constraint FK_FichaF2 go alter table FICHACAMPO drop constraint FK_FichaF3 go alter table FICHACAMPO drop constraint FK_FichaF4 go alter table FICHACAMPO drop constraint FK_FichaF5 go alter table FICHACAMPO drop constraint FK_FichaV1 go alter table FICHACAMPO drop constraint FK_FichaV2 go alter table FICHACAMPO drop constraint FK_FichaV3 go alter table FICHACAMPO drop constraint FK_FichaV4 go alter table FICHACAMPO drop constraint FK_FichaV5 go alter table FICHACAMPO drop constraint FK_FichaG1 go alter table FICHACAMPO drop constraint FK_FichaG2 go alter table FICHACAMPO drop constraint FK_FichaG3 go alter table FICHACAMPO drop constraint FK_FichaG4 go alter table FICHACAMPO drop constraint FK_FichaG5

Page 24: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 24

go alter table FICHACAMPO drop constraint FK_FichaG6 go alter table FICHACAMPO drop constraint FK_FichaG7 go alter table FICHACAMPO drop constraint FK_FichasCampana go alter table FICHACAMPO drop constraint FK_CampanaEstacion go alter table FICHACAMPO drop constraint FK_FichaPrograma go alter table FICHACAMPO drop constraint FK_FichaHelice go alter table SURBERS drop constraint FK_SurberFicha go alter table FISICOQUIMICO drop constraint FK_FisicoQuimicoFichas go alter table TAXA drop constraint FK_TaxaFichas go if exists (select 1 from sysindexes where id = object_id('FICHACAMPO') and name = 'FIC_NUMERO' and indid > 0 and indid < 255) drop index FICHACAMPO.FIC_NUMERO go if exists (select 1 from sysobjects where id = object_id('FICHACAMPO') and type = 'U') drop table FICHACAMPO go /*==============================================================*/ /* Table: FICHACAMPO */ /*==============================================================*/ create table FICHACAMPO (

Page 25: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 25

TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, FIC_NUMERO numeric(5) not null, FIC_FECHA datetime null, FIC_HORA timestamp null, OBS_CODIGO Numeric(2) null, LLU_CODIGO numeric(1) null, L24_CODIGO numeric(1) null, NUB_CODIGO numeric(1) null, VIE_CODIGO numeric(1) null, ANC_CODIGO numeric(1) null, PRO_CODIGO numeric(1) null, TUR_CODIGO numeric(1) null, TRB_CODIGO numeric(1) null, FIC_SINOCOLOR numeric(1) null, FIC_COLOR character(20) null, FIC_SINOOLOR numeric(1) null, FIC_OLOR character(20) null, FIC_REGLETA numeric(3) null, AGU_CODIGO numeric(1) null, FIC_AGUASABIERTAS character(20) null, MAR_CODIGO numeric(1) null, FIC_MARGENES character(20) null, FIC_CONDUCTIVIDAD numeric(6,2) null, FIC_PH numeric(6,2) null, FIC_TEMPERATURA numeric(6,2) null, FIC_OXIGENO numeric(6,2) null, F1_CODIGO numeric(1) null, F2_CODIGO numeric(1) null, F3_CODIGO numeric(1) null, F4_CODIGO numeric(1) null, F5_CODIGO numeric(1) null, V1_CODIGO numeric(1) null, V2_CODIGO numeric(1) null, V3_CODIGO numeric(1) null, V4_CODIGO numeric(1) null, V5_CODIGO numeric(1) null, G1_CODIGO numeric(1) null, G2_CODIGO numeric(1) null, G3_CODIGO numeric(1) null, G4_CODIGO numeric(1) null, G5_CODIGO numeric(1) null, G6_CODIGO numeric(1) null, G7_CODIGO numeric(1) null, EST_CODIGO character(4) null, FIC_FRASCOSSURBERS numeric(3) null, FIC_FRASCOSRM numeric(3) null, H1F_CODIGO numeric(1) null, H1V_CODIGO numeric(1) null, H1S_CODIGO numeric(1) null, H2F_CODIGO numeric(1) null, H2V_CODIGO numeric(1) null, H2S_CODIGO numeric(1) null, H3F_CODIGO numeric(1) null, H3V_CODIGO numeric(1) null, H3S_CODIGO numeric(1) null, H4F_CODIGO numeric(1) null, H4V_CODIGO numeric(1) null,

Page 26: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 26

H4S_CODIGO numeric(1) null, H5F_CODIGO numeric(1) null, H5V_CODIGO numeric(1) null, H5S_CODIGO numeric(1) null, H6F_CODIGO numeric(1) null, H6V_CODIGO numeric(1) null, H6S_CODIGO numeric(1) null, FIC_ARCHIVO character(200) null, PRG_CODIGO character(20) null, HEL_CODIGO numeric(2) null, FIC_COMENTARIO text null, constraint PK_FICHACAMPO primary key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO)) go /*==============================================================*/ /* Index: FIC_NUMERO */ /*==============================================================*/ create unique index FIC_NUMERO on FICHACAMPO (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) go alter table FICHACAMPO add constraint "FK_Campana-Nubocidad" foreign key (NUB_CODIGO) references NUBOCIDAD (NUB_CODIGO) go alter table FICHACAMPO add constraint "FK_Campana-Lluvia" foreign key (LLU_CODIGO) references LLUVIA (LLU_CODIGO) go alter table FICHACAMPO add constraint "FK_Campana-Viento" foreign key (VIE_CODIGO) references VIENTO (VIE_CODIGO) go alter table FICHACAMPO add constraint "FK_Campana-Lluvia24" foreign key (L24_CODIGO) references LLUVIA24 (L24_CODIGO) go alter table FICHACAMPO add constraint FK_ObservadorFicha foreign key (OBS_CODIGO) references OBSERVADORES (OBS_CODIGO) go alter table FICHACAMPO add constraint FK_FichaAncho foreign key (ANC_CODIGO) references ANCHO (ANC_CODIGO) go alter table FICHACAMPO add constraint FK_FichaProfundidad foreign key (PRO_CODIGO) references PROFUNDIDAD (PRO_CODIGO) go alter table FICHACAMPO add constraint FK_FichaTurbulencia foreign key (TUR_CODIGO)

Page 27: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 27

references TURBULENCIA (TUR_CODIGO) go alter table FICHACAMPO add constraint FK_FichaTurbidez foreign key (TRB_CODIGO) references TURBIDEZ (TRB_CODIGO) go alter table FICHACAMPO add constraint FK_FichasAguasAbiertas foreign key (AGU_CODIGO) references AGUASABIERTAS (AGU_CODIGO) go alter table FICHACAMPO add constraint FK_FichasMargenes foreign key (MAR_CODIGO) references MARGENES (MAR_CODIGO) go alter table FICHACAMPO add constraint FK_FichaF1 foreign key (F1_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaF2 foreign key (F2_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaF3 foreign key (F3_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaF4 foreign key (F4_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaF5 foreign key (F5_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaV1 foreign key (V1_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaV2 foreign key (V2_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaV3 foreign key (V3_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go

Page 28: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 28

alter table FICHACAMPO add constraint FK_FichaV4 foreign key (V4_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaV5 foreign key (V5_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG1 foreign key (G1_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG2 foreign key (G2_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG3 foreign key (G3_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG4 foreign key (G4_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG5 foreign key (G5_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG6 foreign key (G6_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichaG7 foreign key (G7_CODIGO) references PUNTAJEHABITAT (PUN_CODIGO) go alter table FICHACAMPO add constraint FK_FichasCampana foreign key (TIP_CODIGO, CAM_NUMERO) references CAMPANA (TIP_CODIGO, CAM_NUMERO) go alter table FICHACAMPO add constraint FK_CampanaEstacion foreign key (EST_CODIGO) references ESTACION (EST_CODIGO) go alter table FICHACAMPO add constraint FK_FichaPrograma foreign key (PRG_CODIGO) references PROGRAMAS (PRG_CODIGO)

Page 29: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 29

go alter table FICHACAMPO add constraint FK_FichaHelice foreign key (HEL_CODIGO) references HELICEENCABEZADO (HEL_CODIGO) go

4.11 FisicoQuimico

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No fic_Numero Numeric 5 No qui_Codigo Numeric 3 No qui_Valor Numeric 10,3 Si

Primary Key

- tip_Codigo - cam_Numero - fic_Numero - qui_Codigo Dependencias Objetos que dependen de FisicoQuimico:

Objetos de los que depende FisicoQuimico: - FichaCampo - Quimicos

Código de creación

alter table FISICOQUIMICO drop constraint FK_FisicoQuimicoFichas go alter table FISICOQUIMICO drop constraint FK_QuimicosAnalisis go if exists (select 1 from sysindexes where id = object_id('FISICOQUIMICO') and name = 'QUI_CODIGO' and indid > 0 and indid < 255) drop index FISICOQUIMICO.QUI_CODIGO go if exists (select 1 from sysobjects where id = object_id('FISICOQUIMICO') and type = 'U') drop table FISICOQUIMICO

Page 30: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 30

go /*==============================================================*/ /* Table: FISICOQUIMICO */ /*==============================================================*/ create table FISICOQUIMICO ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, FIC_NUMERO numeric(5) not null, QUI_CODIGO numeric(2) not null, QUI_VALOR numeric(10,3) null, constraint PK_FISICOQUIMICO primary key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, QUI_CODIGO)) go /*==============================================================*/ /* Index: QUI_CODIGO */ /*==============================================================*/ create unique index QUI_CODIGO on FISICOQUIMICO (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, QUI_CODIGO) go alter table FISICOQUIMICO add constraint FK_FisicoQuimicoFichas foreign key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) references FICHACAMPO (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) go alter table FISICOQUIMICO add constraint FK_QuimicosAnalisis foreign key (QUI_CODIGO) references QUIMICOS (QUI_CODIGO) go

4.12 Genero

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

gen_Codigo Numeric 3 No fam_Codigo Numeric 3 No gen_Nombre Character 20 Si

Primary Key

- gen_Codigo Dependencias Objetos que dependen de Genero: - Invertebrados

Objetos de los que depende Genero: - Familia

Page 31: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 31

Código de creación

alter table GENERO drop constraint FK_FamiliaGenero go alter table INVERTEBRADOS drop constraint FK_GeneroInv go if exists (select 1 from sysindexes where id = object_id('GENERO') and name = 'GEN_CODIGO' and indid > 0 and indid < 255) drop index GENERO.GEN_CODIGO go if exists (select 1 from sysobjects where id = object_id('GENERO') and type = 'U') drop table GENERO go /*==============================================================*/ /* Table: GENERO */ /*==============================================================*/ create table GENERO ( GEN_CODIGO numeric(3) not null, FAM_CODIGO numeric(3) null, GEN_NOMBRE character(30) null, constraint PK_GENERO primary key (GEN_CODIGO)) go /*==============================================================*/ /* Index: GEN_CODIGO */ /*==============================================================*/ create unique index GEN_CODIGO on GENERO (GEN_CODIGO) go alter table GENERO add constraint FK_FamiliaGenero foreign key (FAM_CODIGO) references FAMILIA (FAM_CODIGO) go

4.13 HeliceDetalle

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

hel_Codigo Numeric 2 No hel_Vueltas Numeric 3 No hel_Valor Numeric 10,4 Si

Page 32: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 32

Primary Key - hel_Codigo - hel_Vueltas Dependencias Objetos que dependen de HeliceDetalle:

Objetos de los que depende HeliceDetalle: - HeliceEncabezado

Código de creación

alter table HELICEDETALLE drop constraint FK_HeliceDetalle go if exists (select 1 from sysindexes where id = object_id('HELICEDETALLE') and name = 'HEL_VUELTAS' and indid > 0 and indid < 255) drop index HELICEDETALLE.HEL_VUELTAS go if exists (select 1 from sysobjects where id = object_id('HELICEDETALLE') and type = 'U') drop table HELICEDETALLE go /*==============================================================*/ /* Table: HELICEDETALLE */ /*==============================================================*/ create table HELICEDETALLE ( HEL_CODIGO numeric(2) not null, HEL_VUELTAS numeric(3) not null, HEL_VALOR numeric(10,4) null, constraint PK_HELICEDETALLE primary key (HEL_CODIGO, HEL_VUELTAS)) go /*==============================================================*/ /* Index: HEL_VUELTAS */ /*==============================================================*/ create unique index HEL_VUELTAS on HELICEDETALLE (HEL_CODIGO, HEL_VUELTAS) go alter table HELICEDETALLE add constraint FK_HeliceDetalle foreign key (HEL_CODIGO) references HELICEENCABEZADO (HEL_CODIGO) go

Page 33: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 33

4.14 HeliceEncabezado

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

hel_Codigo Numeric 2 No hel_Nombre Character 20 Si

Primary Key

- hel_Codigo Dependencias Objetos que dependen de HeliceEncabezado: - FichaCampo - Morfologia_Regleta - HeliceDetalle

Objetos de los que depende HeliceEncabezado:

Código de creación

alter table HELICEDETALLE drop constraint FK_HeliceDetalle go alter table FICHACAMPO drop constraint FK_FichaHelice go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaHelice go if exists (select 1 from sysindexes where id = object_id('HELICEENCABEZADO') and name = 'HEL_CODIGO' and indid > 0 and indid < 255) drop index HELICEENCABEZADO.HEL_CODIGO go if exists (select 1 from sysobjects where id = object_id('HELICEENCABEZADO') and type = 'U') drop table HELICEENCABEZADO go /*==============================================================*/ /* Table: HELICEENCABEZADO */ /*==============================================================*/ create table HELICEENCABEZADO ( HEL_CODIGO numeric(2) not null, HEL_NOMBRE character(20) null, constraint PK_HELICEENCABEZADO primary key (HEL_CODIGO)) go

Page 34: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 34

/*==============================================================*/ /* Index: HEL_CODIGO */ /*==============================================================*/ create unique index HEL_CODIGO on HELICEENCABEZADO (HEL_CODIGO) go

4.15 Invertebrados

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

inv_Codigo Numeric 5 No gen_Codigo Numeric 3 No inv_Nombre Character 30 Si inv_Foto Imagen 16 Si inv_Frasco Character 10 Si inv_Comentario Text 16 Si

Primary Key

- inv_Codigo Dependencias Objetos que dependen de Invertebrados: - Taxa

Objetos de los que depende Invertebrados: - Genero

Código de creación

alter table INVERTEBRADOS drop constraint FK_GeneroInv go alter table TAXA drop constraint FK_TaxaInvertebrados go if exists (select 1 from sysindexes where id = object_id('INVERTEBRADOS') and name = 'INV_CODIGO' and indid > 0 and indid < 255) drop index INVERTEBRADOS.INV_CODIGO go if exists (select 1 from sysobjects where id = object_id('INVERTEBRADOS') and type = 'U') drop table INVERTEBRADOS go

Page 35: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 35

/*==============================================================*/ /* Table: INVERTEBRADOS */ /*==============================================================*/ create table INVERTEBRADOS ( INV_CODIGO numeric(5) not null, GEN_CODIGO numeric(3) null, INV_NOMBRE character(30) null, INV_FOTO image null, INV_FRASCO character(20) null, INV_COMENTARIO text null, constraint PK_INVERTEBRADOS primary key (INV_CODIGO)) go /*==============================================================*/ /* Index: INV_CODIGO */ /*==============================================================*/ create unique index INV_CODIGO on INVERTEBRADOS (INV_CODIGO) go alter table INVERTEBRADOS add constraint FK_GeneroInv foreign key (GEN_CODIGO) references GENERO (GEN_CODIGO) go

4.16 Lluvia

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

llu_Codigo Numeric 1 No llu_Nombre Character 10 Si

Primary Key

- llu_Codigo Dependencias Objetos que dependen de Lluvia: - FichaCampo

Objetos de los que depende Lluvia:

Código de creación

alter table FICHACAMPO drop constraint "FK_Campana-Lluvia" go if exists (select 1 from sysindexes where id = object_id('LLUVIA') and name = 'LLU_CODIGO' and indid > 0 and indid < 255) drop index LLUVIA.LLU_CODIGO go

Page 36: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 36

if exists (select 1 from sysobjects where id = object_id('LLUVIA') and type = 'U') drop table LLUVIA go /*==============================================================*/ /* Table: LLUVIA */ /*==============================================================*/ create table LLUVIA ( LLU_CODIGO numeric(1) not null, LLU_NOMBRE character(10) null, constraint PK_LLUVIA primary key (LLU_CODIGO)) go /*==============================================================*/ /* Index: LLU_CODIGO */ /*==============================================================*/ create unique index LLU_CODIGO on LLUVIA (LLU_CODIGO) go

4.17 Lluvia24

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

l24_Codigo Numeric 1 No l24_Nombre Character 10 Si

Primary Key

- llu_Codigo Dependencias Objetos que dependen de Lluvia24: - FichaCampo

Objetos de los que depende Lluvia24:

Código de creación

alter table FICHACAMPO drop constraint "FK_Campana-Lluvia24" go if exists (select 1 from sysindexes where id = object_id('LLUVIA24') and name = 'L24_CODIGO' and indid > 0 and indid < 255) drop index LLUVIA24.L24_CODIGO go if exists (select 1

Page 37: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 37

from sysobjects where id = object_id('LLUVIA24') and type = 'U') drop table LLUVIA24 go /*==============================================================*/ /* Table: LLUVIA24 */ /*==============================================================*/ create table LLUVIA24 ( L24_CODIGO numeric(1) not null, L24_NOMBRE character(10) null, constraint PK_LLUVIA24 primary key (L24_CODIGO)) go /*==============================================================*/ /* Index: L24_CODIGO */ /*==============================================================*/ create unique index L24_CODIGO on LLUVIA24 (L24_CODIGO) go

4.18 Margenes

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

mar_Codigo Numeric 1 No mar_Nombre Character 20 Si

Primary Key

- llu_Codigo Dependencias Objetos que dependen de Margenes: - FichaCampo

Objetos de los que depende Margenes:

Código de creación

alter table FICHACAMPO drop constraint FK_FichasMargenes go if exists (select 1 from sysindexes where id = object_id('MARGENES') and name = 'MAR_CODIGO' and indid > 0 and indid < 255) drop index MARGENES.MAR_CODIGO go if exists (select 1 from sysobjects where id = object_id('MARGENES')

Page 38: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 38

and type = 'U') drop table MARGENES go /*==============================================================*/ /* Table: MARGENES */ /*==============================================================*/ create table MARGENES ( MAR_CODIGO numeric(1) not null, MAR_NOMBRE character(10) null, constraint PK_MARGENES primary key (MAR_CODIGO)) go /*==============================================================*/ /* Index: MAR_CODIGO */ /*==============================================================*/ create unique index MAR_CODIGO on MARGENES (MAR_CODIGO) go

4.19 Morfologia_Caudal

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No mor_Numero Numeric 2 No tra_Numero Numeric 2 No ver_Numero Numeric 2 No ver_Distancia Numeric 8,2 Si ver_Profundidad Numeric 3 Si ver_DistFondo1 Numeric 3 Si ver_Vueltas1 Numeric 3 Si ver_Velocidad1 Numeric 7,4 Si ver_DistFondo2 Numeric 3 Si ver_Vueltas2 Numeric 3 Si ver_Velocidad2 Numeric 7,4 Si ver_DistFondo3 Numeric 3 Si ver_Vueltas3 Numeric 3 Si ver_Velocidad3 Numeric 7,4 Si ver_DistFondo4 Numeric 3 Si ver_Vueltas4 Numeric 3 Si ver_Velocidad4 Numeric 7,4 Si ver_DistFondo5 Numeric 3 Si ver_Vueltas5 Numeric 3 Si ver_Velocidad5 Numeric 7,4 Si ver_DistFondo6 Numeric 3 Si ver_Vueltas6 Numeric 3 Si ver_Velocidad6 Numeric 7,4 Si ver_Observaciones Text 16 Si

Page 39: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 39

Primary Key - tip_Codigo - cam_Numero - mor_Numero - tra_Numero - ver_Numero Dependencias Objetos que dependen de Morfologia_Caudal:

Objetos de los que depende Morfologia_Caudal: - Morfologia_Topografia

Código de creación

alter table MORFOLOGIA_CAUDAL drop constraint FK_MorfologiaCaudal go if exists (select 1 from sysindexes where id = object_id('MORFOLOGIA_CAUDAL') and name = 'VER_NUMERO' and indid > 0 and indid < 255) drop index MORFOLOGIA_CAUDAL.VER_NUMERO go if exists (select 1 from sysobjects where id = object_id('MORFOLOGIA_CAUDAL') and type = 'U') drop table MORFOLOGIA_CAUDAL go /*==============================================================*/ /* Table: MORFOLOGIA_CAUDAL */ /*==============================================================*/ create table MORFOLOGIA_CAUDAL ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, MOR_NUMERO numeric(2) not null, TRA_NUMERO numeric(2) not null, VER_NUMERO numeric(2) not null, VER_DISTANCIA numeric(8,2) null, VER_PROFUNDIDAD numeric(3) null, VER_DISTFONDO1 numeric(3) null, VER_VUELTAS1 numeric(3) null, VER_VELOCIDAD1 numeric(7,4) null, VER_DISTFONDO2 numeric(3) null, VER_VUELTAS2 numeric(3) null, VER_VELOCIDAD2 numeric(7,4) null, VER_DISTFONDO3 numeric(3) null, VER_VUELTAS3 numeric(3) null, VER_VELOCIDAD3 numeric(7,4) null, VER_DISTFONDO4 numeric(3) null, VER_VUELTAS4 numeric(3) null,

Page 40: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 40

VER_VELOCIDAD4 numeric(7,4) null, VER_DISTFONDO5 numeric(3) null, VER_VUELTAS5 numeric(3) null, VER_VELOCIDAD5 numeric(7,4) null, VER_DISTFONDO6 numeric(3) null, VER_VUELTAS6 numeric(3) null, VER_VELOCIDAD6 numeric(7,4) null, VER_OBSERVACIONES text null, constraint PK_MORFOLOGIA_CAUDAL primary key (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO, VER_NUMERO)) go /*==============================================================*/ /* Index: VER_NUMERO */ /*==============================================================*/ create unique index VER_NUMERO on MORFOLOGIA_CAUDAL (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO, VER_NUMERO) go alter table MORFOLOGIA_CAUDAL add constraint FK_MorfologiaCaudal foreign key (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO) references MORFOLOGIA_TOPOGRAFIA (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO) go

4.20 Morfologia_Regleta

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No mor_Numero Numeric 2 No est_Codigo Character 4 No mor_Fecha Datetime 8 Si reg_NivelAgua Numeric 8,2 Si reg_Bajo Numeric 8,2 Si reg_Medio Numeric 8,2 Si reg_Alto Numeric 8,2 Si reg_Azimut Numeric 8,2 Si reg_Medio-Bajo Numeric 8,2 Si reg_Alto-Medio Numeric 8,2 Si reg_SumDiferencias Numeric 8,2 Si reg_Archivo Character 200 Si prg_Codigo Character 20 Si hel_Codigo Numeric 2 No reg_Observaciones Texto 16 Si

Primary Key

- tip_Codigo - cam_Numero - mor_Numero

Page 41: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 41

Dependencias Objetos que dependen de Morfologia_Regleta: - Morfologia_Topografia

Objetos de los que depende Morfologia_ Regleta: - Campaña - Estacion - HeliceEncabezado - Programas

Código de creación

alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaCampana go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaEstacion go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaPrograma go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaHelice go alter table MORFOLOGIA_TOPOGRAFIA drop constraint FK_MorfologiaTopografia go if exists (select 1 from sysindexes where id = object_id('MORFOLOGIA_REGLETA') and name = 'MOR_NUMERO' and indid > 0 and indid < 255) drop index MORFOLOGIA_REGLETA.MOR_NUMERO go if exists (select 1 from sysobjects where id = object_id('MORFOLOGIA_REGLETA') and type = 'U') drop table MORFOLOGIA_REGLETA go /*==============================================================*/ /* Table: MORFOLOGIA_REGLETA */ /*==============================================================*/ create table MORFOLOGIA_REGLETA ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, MOR_NUMERO numeric(2) not null, EST_CODIGO character(4) null,

Page 42: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 42

MOR_FECHA datetime null, REG_NIVELAGUA numeric(8,2) null, REG_BAJO numeric(8,2) null, REG_MEDIO numeric(8,2) null, REG_ALTO numeric(8,2) null, REG_AZIMUT numeric(8,2) null, REG_MEDIO_BAJO numeric(8,2) null, REG_ALTO_MEDIO numeric(8,2) null, REG_SUMDIFERENCIAS numeric(8,2) null, REG_ARCHIVO character(200) null, PRG_CODIGO character(20) null, HEL_CODIGO numeric(2) null, REG_OBSERVACIONES text null, constraint PK_MORFOLOGIA_REGLETA primary key (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO)) go /*==============================================================*/ /* Index: MOR_NUMERO */ /*==============================================================*/ create unique index MOR_NUMERO on MORFOLOGIA_REGLETA (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO) go alter table MORFOLOGIA_REGLETA add constraint FK_MorfologiaCampana foreign key (TIP_CODIGO, CAM_NUMERO) references CAMPANA (TIP_CODIGO, CAM_NUMERO) go alter table MORFOLOGIA_REGLETA add constraint FK_MorfologiaEstacion foreign key (EST_CODIGO) references ESTACION (EST_CODIGO) go alter table MORFOLOGIA_REGLETA add constraint FK_MorfologiaPrograma foreign key (PRG_CODIGO) references PROGRAMAS (PRG_CODIGO) go alter table MORFOLOGIA_REGLETA add constraint FK_MorfologiaHelice foreign key (HEL_CODIGO) references HELICEENCABEZADO (HEL_CODIGO) go

4.21 Morfologia_Topografia

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No mor_Numero Numeric 2 No tra_Numero Numeric 2 No tra_Aforo Bit 1 Si tra_DistanciaRI Numeric 8,2 Si tra_DistanciaRD Numeric 8,2 Si

Page 43: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 43

tra_NivelAgua Numeric 8,2 Si tra_BajoRD Numeric 8,2 Si tra_BajoINT Numeric 8,2 Si tra_BajoRI Numeric 8,2 Si tra_MedioRD Numeric 8,2 Si tra_MedioINT Numeric 8,2 Si tra_MedioRI Numeric 8,2 Si tra_AltoRD Numeric 8,2 Si tra_AltoINT Numeric 8,2 Si tra_AltoRI Numeric 8,2 Si tra_AzimutRD Numeric 3 Si tra_AzimutINT Numeric 3 Si tra_AzimutRI Numeric 3 Si tra_Medio-BajoRD Numeric 8,2 Si tra_Medio-BajoINT Numeric 8,2 Si tra_Medio-BajoRI Numeric 8,2 Si tra_Alto-MedioRD Numeric 8,2 Si tra_Alto-MedioINT Numeric 8,2 Si tra_Alto-MedioRI Numeric 8,2 Si tra_A-M_M-B_RD Numeric 8,2 Si tra_A-M_M-B_INT Numeric 8,2 Si tra_A-M_M-B_RI Numeric 8,2 Si tra_Observaciones Numeric 16 Si

Primary Key

- tip_Codigo - cam_Numero - mor_Numero - tra_Numero Dependencias Objetos que dependen de Morfologia_Topografia: - Morfologia_Caudal

Objetos de los que depende Morfologia_ Topografia: - Morfologia_Regleta

Código de creación

alter table MORFOLOGIA_TOPOGRAFIA drop constraint FK_MorfologiaTopografia go alter table MORFOLOGIA_CAUDAL drop constraint FK_MorfologiaCaudal go if exists (select 1 from sysindexes where id = object_id('MORFOLOGIA_TOPOGRAFIA') and name = 'TRA_NUMERO' and indid > 0

Page 44: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 44

and indid < 255) drop index MORFOLOGIA_TOPOGRAFIA.TRA_NUMERO go if exists (select 1 from sysobjects where id = object_id('MORFOLOGIA_TOPOGRAFIA') and type = 'U') drop table MORFOLOGIA_TOPOGRAFIA go /*==============================================================*/ /* Table: MORFOLOGIA_TOPOGRAFIA */ /*==============================================================*/ create table MORFOLOGIA_TOPOGRAFIA ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, MOR_NUMERO numeric(2) not null, TRA_NUMERO numeric(2) not null, TRA_AFORO bit null, TRA_DISTANCIARI numeric(8,2) null, TRA_DISTANCIARD numeric(8,2) null, TRA_NIVELAGUA numeric(8,2) null, TRA_BAJORD numeric(8,2) null, TRA_BAJOINT numeric(8,2) null, TRA_BAJORI numeric(8,2) null, TRA_MEDIORD numeric(8,2) null, TRA_MEDIOINT numeric(8,2) null, TRA_MEDIORI numeric(8,2) null, TRA_ALTORD numeric(8,2) null, TRA_ALTOINT numeric(8,2) null, TRA_ALTORI numeric(8,2) null, TRA_AZIMUTRD numeric(3) null, TRA_AZIMUTINT numeric(3) null, TRA_AZIMUTRI numeric(3) null, TRA_MEDIO_BAJORD numeric(8,2) null, TRA_MEDIO_BAJOINT numeric(8,2) null, TRA_MEDIO_BAJORI numeric(8,2) null, TRA_ALTO_MEDIORD numeric(8,2) null, TRA_ALTO_MEDIOINT numeric(8,2) null, TRA_ALTO_MEDIORI numeric(8,2) null, TRA_A_M_M_B_RD numeric(8,2) null, TRA_A_M_M_B_INT numeric(8,2) null, TRA_A_M_M_B_RI numeric(8,2) null, TRA_OBSERVACIONES text null, constraint PK_MORFOLOGIA_TOPOGRAFIA primary key (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO)) go /*==============================================================*/ /* Index: TRA_NUMERO */ /*==============================================================*/ create unique index TRA_NUMERO on MORFOLOGIA_TOPOGRAFIA (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO, TRA_NUMERO) go alter table MORFOLOGIA_TOPOGRAFIA add constraint FK_MorfologiaTopografia foreign key (TIP_CODIGO, CAM_NUMERO,

Page 45: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 45

MOR_NUMERO) references MORFOLOGIA_REGLETA (TIP_CODIGO, CAM_NUMERO, MOR_NUMERO) go

4.22 Nubocidad

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

nub_Codigo Numeric 1 No nub_Nombre Character 10 Si

Primary Key

- nub_Codigo Dependencias Objetos que dependen de Nubocidad: - FichaCampo

Objetos de los que depende Nubocidad:

Código de creación

alter table FICHACAMPO drop constraint "FK_Campana-Nubocidad" go if exists (select 1 from sysindexes where id = object_id('NUBOCIDAD') and name = 'NUB_CODIGO' and indid > 0 and indid < 255) drop index NUBOCIDAD.NUB_CODIGO go if exists (select 1 from sysobjects where id = object_id('NUBOCIDAD') and type = 'U') drop table NUBOCIDAD go /*==============================================================*/ /* Table: NUBOCIDAD */ /*==============================================================*/ create table NUBOCIDAD ( NUB_CODIGO numeric(1) not null, NUB_NOMBRE character(10) null, constraint PK_NUBOCIDAD primary key (NUB_CODIGO)) go /*==============================================================*/ /* Index: NUB_CODIGO */ /*==============================================================*/

Page 46: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 46

create unique index NUB_CODIGO on NUBOCIDAD (NUB_CODIGO) go

4.23 Observadores

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

obs_Codigo Numeric 2 No obs_Nombre Character 40 Si

Primary Key

- obs_Codigo Dependencias Objetos que dependen de Nubocidad: - FichaCampo - ObservadoresCampana

Objetos de los que depende Nubocidad:

Código de creación

alter table FICHACAMPO drop constraint FK_ObservadorFicha go alter table OBSERVADORESCAMPANA drop constraint FK_Observadores go if exists (select 1 from sysindexes where id = object_id('OBSERVADORES') and name = 'OBS_CODIGO' and indid > 0 and indid < 255) drop index OBSERVADORES.OBS_CODIGO go if exists (select 1 from sysobjects where id = object_id('OBSERVADORES') and type = 'U') drop table OBSERVADORES go /*==============================================================*/ /* Table: OBSERVADORES */ /*==============================================================*/ create table OBSERVADORES ( OBS_CODIGO numeric(2) not null, OBS_NOMBRE character(40) null, constraint PK_OBSERVADORES primary key (OBS_CODIGO)) go

Page 47: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 47

/*==============================================================*/ /* Index: OBS_CODIGO */ /*==============================================================*/ create unique index OBS_CODIGO on OBSERVADORES (OBS_CODIGO) go

4.24 ObservadoresCampana

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

obs_Codigo Numeric 2 No tip_Codigo Numeric 1 No cam_Numero Numeric 5 No

Primary Key

- obs_Codigo - tip_Codigo - cam_Numero Dependencias Objetos que dependen de Nubocidad: - Campana - Observadores

Objetos de los que depende Nubocidad:

Código de creación

alter table OBSERVADORESCAMPANA drop constraint FK_Observadores go alter table OBSERVADORESCAMPANA drop constraint FK_Campana go if exists (select 1 from sysindexes where id = object_id('OBSERVADORESCAMPANA') and name = 'OBSCAM' and indid > 0 and indid < 255) drop index OBSERVADORESCAMPANA.OBSCAM go if exists (select 1 from sysobjects where id = object_id('OBSERVADORESCAMPANA') and type = 'U') drop table OBSERVADORESCAMPANA go /*==============================================================*/ /* Table: OBSERVADORESCAMPANA */

Page 48: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 48

/*==============================================================*/ create table OBSERVADORESCAMPANA ( OBS_CODIGO numeric(2) not null, TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, constraint PK_OBSERVADORESCAMPANA primary key (TIP_CODIGO, OBS_CODIGO, CAM_NUMERO)) /*==============================================================*/ /* Index: OBSCAM */ /*==============================================================*/ create unique index OBSCAM on OBSERVADORESCAMPANA (TIP_CODIGO, OBS_CODIGO, CAM_NUMERO) go alter table OBSERVADORESCAMPANA add constraint FK_Observadores foreign key (OBS_CODIGO) references OBSERVADORES (OBS_CODIGO) go alter table OBSERVADORESCAMPANA add constraint FK_Campana foreign key (TIP_CODIGO, CAM_NUMERO) references CAMPANA (TIP_CODIGO, CAM_NUMERO) go

4.25 Orden

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

ord_Codigo Numeric 3 No scl_Codigo Numeric 3 No ord_Nombre Character 20 Si

Primary Key

- ord_Codigo Dependencias Objetos que dependen de Orden: - Familia

Objetos de los que depende Orden: - SubClase

Código de creación

alter table ORDEN drop constraint FK_SubcOrden go alter table FAMILIA drop constraint FK_OrdenFamilia go if exists (select 1 from sysindexes

Page 49: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 49

where id = object_id('ORDEN') and name = 'ORD_CODIGO' and indid > 0 and indid < 255) drop index ORDEN.ORD_CODIGO go if exists (select 1 from sysobjects where id = object_id('ORDEN') and type = 'U') drop table ORDEN go /*==============================================================*/ /* Table: ORDEN */ /*==============================================================*/ create table ORDEN ( ORD_CODIGO numeric(3) not null, SCL_CODIGO numeric(3) null, ORD_NOMBRE character(20) null, constraint PK_ORDEN primary key (ORD_CODIGO)) go /*==============================================================*/ /* Index: ORD_CODIGO */ /*==============================================================*/ create unique index ORD_CODIGO on ORDEN (ORD_CODIGO) go alter table ORDEN add constraint FK_SubcOrden foreign key (SCL_CODIGO) references SUBCLASE (SCL_CODIGO) go

4.26 Parametros

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

RutaDoc Character 200 Si Primary Key

Dependencias Objetos que dependen de Parametros:

Objetos de los que depende Parametros:

Código de creación

if exists (select 1 from sysobjects where id = object_id('PARAMETROS') and type = 'U') drop table PARAMETROS go

Page 50: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 50

/*==============================================================*/ /* Table: PARAMETROS */ /*==============================================================*/ create table PARAMETROS ( RUTADOC character(200) null) go

4.27 Phylum

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

phy_Codigo Numeric 3 No phy_Nombre Character 20 Si

Primary Key

- Phy_Codigo

Dependencias Objetos que dependen de Phylum: - Clase

Objetos de los que depende Phylum:

Código de creación

alter table CLASE drop constraint FK_PhylumClase go if exists (select 1 from sysindexes where id = object_id('PHYLUM') and name = 'PHY_CODIGO' and indid > 0 and indid < 255) drop index PHYLUM.PHY_CODIGO go if exists (select 1 from sysobjects where id = object_id('PHYLUM') and type = 'U') drop table PHYLUM go /*==============================================================*/ /* Table: PHYLUM */ /*==============================================================*/ create table PHYLUM ( PHY_CODIGO numeric(3) not null, PHY_NOMBRE character(20) null, constraint PK_PHYLUM primary key (PHY_CODIGO)) go

Page 51: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 51

/*==============================================================*/ /* Index: PHY_CODIGO */ /*==============================================================*/ create unique index PHY_CODIGO on PHYLUM (PHY_CODIGO) go

4.28 Plantillas

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

pla_Numero Numeric 2 No pla_Nombre Character 50 Si pla_Archivo Character 200 Si prg_Codigo Character 20 Si

Primary Key

- pla_Numero

Dependencias Objetos que dependen de Plantillas:

Objetos de los que depende Plantillas: - Programas

Código de creación

alter table PLANTILLAS drop constraint FK_PlantillaPrg go if exists (select 1 from sysindexes where id = object_id('PLANTILLAS') and name = 'PLA_NUMERO' and indid > 0 and indid < 255) drop index PLANTILLAS.PLA_NUMERO go if exists (select 1 from sysobjects where id = object_id('PLANTILLAS') and type = 'U') drop table PLANTILLAS go /*==============================================================*/ /* Table: PLANTILLAS */ /*==============================================================*/ create table PLANTILLAS ( PLA_NUMERO numeric(2) not null, PLA_NOMBRE character(50) null, PLA_ARCHIVO character(200) null,

Page 52: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 52

PRG_CODIGO character(20) null, constraint PK_PLANTILLAS primary key (PLA_NUMERO)) go /*==============================================================*/ /* Index: PLA_NUMERO */ /*==============================================================*/ create unique index PLA_NUMERO on PLANTILLAS (PLA_NUMERO) go alter table PLANTILLAS add constraint FK_PlantillaPrg foreign key (PRG_CODIGO) references PROGRAMAS (PRG_CODIGO) go

4.29 Profundidad

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

pro_Codigo Numeric 1 No pro_Nombre Character 10 Si

Primary Key

- pro_Codigo

Dependencias Objetos que dependen de Plantillas: - FichaCampo

Objetos de los que depende Plantillas:

Código de creación

alter table FICHACAMPO drop constraint FK_FichaProfundidad go if exists (select 1 from sysindexes where id = object_id('PROFUNDIDAD') and name = 'PRO_CODIGO' and indid > 0 and indid < 255) drop index PROFUNDIDAD.PRO_CODIGO go if exists (select 1 from sysobjects where id = object_id('PROFUNDIDAD') and type = 'U') drop table PROFUNDIDAD go /*==============================================================*/ /* Table: PROFUNDIDAD */

Page 53: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 53

/*==============================================================*/ create table PROFUNDIDAD ( PRO_CODIGO numeric(1) not null, PRO_NOMBRE character(10) null, constraint PK_PROFUNDIDAD primary key (PRO_CODIGO)) go /*==============================================================*/ /* Index: PRO_CODIGO */ /*==============================================================*/ create unique index PRO_CODIGO on PROFUNDIDAD (PRO_CODIGO) go

4.30 Programas

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

prg_Codigo Character 20 No prg_Nombre Character 50 Si prg_Ruta Character 200 Si

Primary Key

- prg_Codigo

Dependencias Objetos que dependen de Plantillas: - FichaCampo - Morfologia_Regleta - Plantillas - Protocolos - Publicaciones

Objetos de los que depende Plantillas:

Código de creación

alter table PUBLICACIONES drop constraint FK_PublicacionPrg go alter table PROTOCOLOS drop constraint FK_ProtocoloPrg go alter table PLANTILLAS drop constraint FK_PlantillaPrg go alter table FICHACAMPO drop constraint FK_FichaPrograma go alter table MORFOLOGIA_REGLETA drop constraint FK_MorfologiaPrograma go

Page 54: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 54

if exists (select 1 from sysindexes where id = object_id('PROGRAMAS') and name = 'PRG_CODIGO' and indid > 0 and indid < 255) drop index PROGRAMAS.PRG_CODIGO go if exists (select 1 from sysobjects where id = object_id('PROGRAMAS') and type = 'U') drop table PROGRAMAS go /*==============================================================*/ /* Table: PROGRAMAS */ /*==============================================================*/ create table PROGRAMAS ( PRG_CODIGO character(20) not null, PRG_NOMBRE character(50) null, PRG_RUTA character(200) null, constraint PK_PROGRAMAS primary key (PRG_CODIGO)) go /*==============================================================*/ /* Index: PRG_CODIGO */ /*==============================================================*/ create unique index PRG_CODIGO on PROGRAMAS (PRG_CODIGO) go

4.31 Protocolos

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

pro_Numero Numeric 2 No pro_Nombre Character 50 Si pro_Archivo Character 200 Si prg_Codigo Character 20 No

Primary Key

- pro_Numero

Dependencias Objetos que dependen de Protocolos:

Objetos de los que depende Protocolos: - Programas

Código de creación

alter table PROTOCOLOS drop constraint FK_ProtocoloPrg

Page 55: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 55

go if exists (select 1 from sysindexes where id = object_id('PROTOCOLOS') and name = 'PRO_NUMERO' and indid > 0 and indid < 255) drop index PROTOCOLOS.PRO_NUMERO go if exists (select 1 from sysobjects where id = object_id('PROTOCOLOS') and type = 'U') drop table PROTOCOLOS go /*==============================================================*/ /* Table: PROTOCOLOS */ /*==============================================================*/ create table PROTOCOLOS ( PRO_NUMERO numeric(2) not null, PRO_NOMBRE character(50) null, PRO_ARCHIVO character(200) null, PRG_CODIGO character(20) null, constraint PK_PROTOCOLOS primary key (PRO_NUMERO)) go /*==============================================================*/ /* Index: PRO_NUMERO */ /*==============================================================*/ create unique index PRO_NUMERO on PROTOCOLOS (PRO_NUMERO) go alter table PROTOCOLOS add constraint FK_ProtocoloPrg foreign key (PRG_CODIGO) references PROGRAMAS (PRG_CODIGO) go

4.32 Publicaciones

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

pub_Numero Numeric 2 No pub_Nombre Character 50 Si pub_Autor1 Character 50 Si pub_Autor2 Character 50 Si pub_anio Numeric 4 Si pub_periodico Character 20 Si pub_KeyWord Character 100 Si pub_Archivo Character 200 Si prg_Codigo Character 20 No

Page 56: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 56

Primary Key

- pub_Numero

Dependencias Objetos que dependen de Publicaciones:

Objetos de los que depende Publicaciones: - Programas

Código de creación

alter table PUBLICACIONES drop constraint FK_PublicacionPrg go if exists (select 1 from sysindexes where id = object_id('PUBLICACIONES') and name = 'PUB_NUMERO' and indid > 0 and indid < 255) drop index PUBLICACIONES.PUB_NUMERO go if exists (select 1 from sysobjects where id = object_id('PUBLICACIONES') and type = 'U') drop table PUBLICACIONES go /*==============================================================*/ /* Table: PUBLICACIONES */ /*==============================================================*/ create table PUBLICACIONES ( PUB_NUMERO numeric(2) not null, PUB_NOMBRE character(50) null, PUB_AUTOR1 character(50) null, PUB_AUTOR2 character(50) null, PUB_ANIO numeric(4) null, PUB_PERIODICO character(20) null, PUB_KEYWORD character(100) null, PUB_ARCHIVO character(200) null, PRG_CODIGO character(20) null, constraint PK_PUBLICACIONES primary key (PUB_NUMERO)) go /*==============================================================*/ /* Index: PUB_NUMERO */ /*==============================================================*/ create unique index PUB_NUMERO on PUBLICACIONES (PUB_NUMERO) go alter table PUBLICACIONES add constraint FK_PublicacionPrg foreign key (PRG_CODIGO)

Page 57: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 57

references PROGRAMAS (PRG_CODIGO) go

4.33 PuntajeHabitat

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

pun_Codigo Numeric 1 No pin_Nombre Character 15 Si

Primary Key

- pun_Codigo

Dependencias Objetos que dependen de PuntajeHabitat: - FichaCampo Objetos de los que depende PuntajeHabitat:

Código de creación

alter table FICHACAMPO drop constraint FK_FichaF1 go alter table FICHACAMPO drop constraint FK_FichaF2 go alter table FICHACAMPO drop constraint FK_FichaF3 go alter table FICHACAMPO drop constraint FK_FichaF4 go alter table FICHACAMPO drop constraint FK_FichaF5 go alter table FICHACAMPO drop constraint FK_FichaV1 go alter table FICHACAMPO drop constraint FK_FichaV2 go alter table FICHACAMPO drop constraint FK_FichaV3 go alter table FICHACAMPO drop constraint FK_FichaV4

Page 58: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 58

go alter table FICHACAMPO drop constraint FK_FichaV5 go alter table FICHACAMPO drop constraint FK_FichaG1 go alter table FICHACAMPO drop constraint FK_FichaG2 go alter table FICHACAMPO drop constraint FK_FichaG3 go alter table FICHACAMPO drop constraint FK_FichaG4 go alter table FICHACAMPO drop constraint FK_FichaG5 go alter table FICHACAMPO drop constraint FK_FichaG6 go alter table FICHACAMPO drop constraint FK_FichaG7 go if exists (select 1 from sysindexes where id = object_id('PUNTAJEHABITAT') and name = 'PUN_CODIGO' and indid > 0 and indid < 255) drop index PUNTAJEHABITAT.PUN_CODIGO go if exists (select 1 from sysobjects where id = object_id('PUNTAJEHABITAT') and type = 'U') drop table PUNTAJEHABITAT go /*==============================================================*/ /* Table: PUNTAJEHABITAT */ /*==============================================================*/ create table PUNTAJEHABITAT ( PUN_CODIGO numeric(1) not null, PIN_NOMBRE character(15) null, constraint PK_PUNTAJEHABITAT primary key (PUN_CODIGO)) go

Page 59: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 59

/*==============================================================*/ /* Index: PUN_CODIGO */ /*==============================================================*/ create unique index PUN_CODIGO on PUNTAJEHABITAT (PUN_CODIGO) go

4.34 Quimicos

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

qui_Codigo Numeric 2 No und_Codigo Character 10 Si qui_Nombre Character 30 Si

Primary Key

- qui_Codigo

Dependencias Objetos que dependen de Quimicos: - FisicoQuimico

Objetos de los que depende Quimicos: - Unidades

Código de creación

alter table QUIMICOS drop constraint FK_QuimicosUnidades go alter table FISICOQUIMICO drop constraint FK_QuimicosAnalisis go if exists (select 1 from sysindexes where id = object_id('QUIMICOS') and name = 'QUI_CODIGO' and indid > 0 and indid < 255) drop index QUIMICOS.QUI_CODIGO go if exists (select 1 from sysobjects where id = object_id('QUIMICOS') and type = 'U') drop table QUIMICOS go /*==============================================================*/ /* Table: QUIMICOS */ /*==============================================================*/ create table QUIMICOS ( QUI_CODIGO numeric(2) not null, UND_CODIGO character(2) null,

Page 60: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 60

QUI_NOMBRE character(30) null, constraint PK_QUIMICOS primary key (QUI_CODIGO)) go /*==============================================================*/ /* Index: QUI_CODIGO */ /*==============================================================*/ create unique index QUI_CODIGO on QUIMICOS (QUI_CODIGO) go alter table QUIMICOS add constraint FK_QuimicosUnidades foreign key (UND_CODIGO) references UNIDADES (UND_CODIGO) go

4.35 Rios

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

rio_Codigo Character 2 No scu_Codigo Character 2 Si rio_Nombre Character 30 Si

Primary Key

- rio_Codigo

Dependencias Objetos que dependen de Rios: - Estacion

Objetos de los que depende Rios: - SubCuenca

Código de creación

alter table RIOS drop constraint FK_RiosSubcuenca go alter table ESTACION drop constraint FK_EstacionesRio go if exists (select 1 from sysindexes where id = object_id('RIOS') and name = 'RIO_CODIGO' and indid > 0 and indid < 255) drop index RIOS.RIO_CODIGO go if exists (select 1 from sysobjects where id = object_id('RIOS')

Page 61: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 61

and type = 'U') drop table RIOS go /*==============================================================*/ /* Table: RIOS */ /*==============================================================*/ create table RIOS ( RIO_CODIGO character(2) not null, SCU_CODIGO character(2) null, RIO_NOMBRE character(30) null, constraint PK_RIOS primary key (RIO_CODIGO)) go /*==============================================================*/ /* Index: RIO_CODIGO */ /*==============================================================*/ create unique index RIO_CODIGO on RIOS (RIO_CODIGO) go alter table RIOS add constraint FK_RiosSubcuenca foreign key (SCU_CODIGO) references SUBCUENCA (SCU_CODIGO) go

4.36 Rivera

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

riv_Codigo Character 1 No riv_Nombre Character 20 Si

Primary Key

- rio_Codigo

Dependencias Objetos que dependen de Rivera: - Surbers

Objetos de los que depende Rivera:

Código de creación

alter table SURBERS drop constraint FK_SurberRivera go if exists (select 1 from sysindexes where id = object_id('RIVERA') and name = 'RIV_CODIGO' and indid > 0 and indid < 255) drop index RIVERA.RIV_CODIGO go

Page 62: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 62

if exists (select 1 from sysobjects where id = object_id('RIVERA') and type = 'U') drop table RIVERA go /*==============================================================*/ /* Table: RIVERA */ /*==============================================================*/ create table RIVERA ( RIV_CODIGO numeric(1) not null, RIV_NOMBRE character(20) null, constraint PK_RIVERA primary key (RIV_CODIGO)) go /*==============================================================*/ /* Index: RIV_CODIGO */ /*==============================================================*/ create unique index RIV_CODIGO on RIVERA (RIV_CODIGO) go

4.37 SubCuenca

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

scu_Codigo Character 2 No cue_Codigo Character 2 Si scu_Nombre Character 30 Si

Primary Key

- scu_Codigo

Dependencias Objetos que dependen de SubCuenca: - Rios

Objetos de los que depende SubCuenca: - Cuenca

Código de creación

alter table SUBCUENCA drop constraint FK_SubcuencasCuenca go alter table RIOS drop constraint FK_RiosSubcuenca go if exists (select 1 from sysindexes where id = object_id('SUBCUENCA') and name = 'SCU_CODIGO'

Page 63: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 63

and indid > 0 and indid < 255) drop index SUBCUENCA.SCU_CODIGO go if exists (select 1 from sysobjects where id = object_id('SUBCUENCA') and type = 'U') drop table SUBCUENCA go /*==============================================================*/ /* Table: SUBCUENCA */ /*==============================================================*/ create table SUBCUENCA ( SCU_CODIGO character(2) not null, CUE_CODIGO character(2) null, SCU_NOMBRE character(30) null, constraint PK_SUBCUENCA primary key (SCU_CODIGO)) go /*==============================================================*/ /* Index: SCU_CODIGO */ /*==============================================================*/ create unique index SCU_CODIGO on SUBCUENCA (SCU_CODIGO) go alter table SUBCUENCA add constraint FK_SubcuencasCuenca foreign key (CUE_CODIGO) references CUENCA (CUE_CODIGO) go

4.38 SubClase

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

scu_Codigo Numeric 3 No cue_Codigo Numeric 3 Si scu_Nombre Numeric 20 Si

Primary Key

- scu_Codigo

Dependencias Objetos que dependen de SubClase: - Orden

Objetos de los que depende SubClasea: - Clase

Código de creación

alter table SUBCLASE drop constraint FK_ClaseSubc

Page 64: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 64

go alter table ORDEN drop constraint FK_SubcOrden go if exists (select 1 from sysindexes where id = object_id('SUBCLASE') and name = 'SCL_CODIGO' and indid > 0 and indid < 255) drop index SUBCLASE.SCL_CODIGO go if exists (select 1 from sysobjects where id = object_id('SUBCLASE') and type = 'U') drop table SUBCLASE go /*==============================================================*/ /* Table: SUBCLASE */ /*==============================================================*/ create table SUBCLASE ( SCL_CODIGO numeric(3) not null, CLA_CODIGO numeric(3) null, SCL_NOMBRE character(20) null, constraint PK_SUBCLASE primary key (SCL_CODIGO)) go /*==============================================================*/ /* Index: SCL_CODIGO */ /*==============================================================*/ create unique index SCL_CODIGO on SUBCLASE (SCL_CODIGO) go alter table SUBCLASE add constraint FK_ClaseSubc foreign key (CLA_CODIGO) references CLASE (CLA_CODIGO) go

Page 65: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 65

4.39 Surbers

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No fic_Numero Numeric 5 No sur_Numero Numeric 1 No sur_fst Numeric 2 Si riv_Codigo Numeric 1 No fac_Codigo Numeric 1 No veg_Codigo Numeric 1 No sed_Codigo Numeric 1 No ses_Codigo Numeric 1 No scd_Codigo Numeric 1 No scs_Codigo Numeric 1 No sur_Prof1 Numeric 3 Si sur_Prof2 Numeric 3 Si sur_Prof3 Numeric 3 Si sur_Prof4 Numeric 3 Si sur_Vueltas1 Numeric 3 Si sur_Vueltas2 Numeric 3 Si sur_Vueltas3 Numeric 3 Si sur_Vueltas4 Numeric 3 Si sur_Veloc1 Numeric 7,4 Si sur_Veloc2 Numeric 7,4 Si sur_Veloc3 Numeric 7,4 Si sur_Veloc4 Numeric 7,4 Si sur_188 Numeric 2 Si sur_128 Numeric 2 Si sur_90 Numeric 2 Si sur_64 Numeric 2 Si sur_45 Numeric 2 Si sur_32 Numeric 2 Si sur_22 Numeric 2 Si sur_16 Numeric 2 Si sur_sin Bit 1 No sur_SedSeco Numeric 8,2 Si sur_VegSeca Numeric 8,2 Si

Primary Key

- tip_Codigo - cam_Numero - fic_Numero - sur_Numero

Dependencias Objetos que dependen de Surbers:

Page 66: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 66

Objetos de los que depende Surbers: - Facies - FichaCampo - Rivera - Sustrato - Vegetacion

Código de creación

alter table SURBERS drop constraint FK_SurberFicha go alter table SURBERS drop constraint FK_SurberRivera go alter table SURBERS drop constraint FK_SurberFacies go alter table SURBERS drop constraint FK_SurberVegetacion go alter table SURBERS drop constraint "FK_Sed-Dominante" go alter table SURBERS drop constraint "FK_Sed-Secund" go alter table SURBERS drop constraint "FK_Sub-Dominante" go alter table SURBERS drop constraint "FK_Sub-Secund" go if exists (select 1 from sysindexes where id = object_id('SURBERS') and name = 'SUR_NUMERO' and indid > 0 and indid < 255) drop index SURBERS.SUR_NUMERO go if exists (select 1 from sysobjects where id = object_id('SURBERS') and type = 'U') drop table SURBERS go /*==============================================================*/

Page 67: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 67

/* Table: SURBERS */ /*==============================================================*/ create table SURBERS ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, FIC_NUMERO numeric(5) not null, SUR_NUMERO numeric(1) not null, SUR_FST numeric(2) null, RIV_CODIGO numeric(1) null, FAC_CODIGO numeric(1) null, VEG_CODIGO numeric(1) null, SED_CODIGO numeric(1) null, SES_CODIGO numeric(1) null, SCD_CODIGO numeric(1) null, SCS_CODIGO numeric(1) null, SUR_PROF1 numeric(3) null, SUR_PROF2 numeric(3) null, SUR_PROF3 numeric(3) null, SUR_PROF4 numeric(3) null, SUR_VUELTAS1 numeric(3) null, SUR_VUELTAS2 numeric(3) null, SUR_VUELTAS3 numeric(3) null, SUR_VUELTAS4 numeric(3) null, SUR_VELOC1 numeric(7,4) null, SUR_VELOC2 numeric(7,4) null, SUR_VELOC3 numeric(7,4) null, SUR_VELOC4 numeric(7,4) null, SUR_188 numeric(2) null, SUR_128 numeric(2) null, SUR_90 numeric(2) null, SUR_64 numeric(2) null, SUR_45 numeric(2) null, SUR_32 numeric(2) null, SUR_22 numeric(2) null, SUR_16 numeric(2) null, SUR_SIN character(1) null, SUR_SEDSECO numeric(8,2) null, SUR_VEGSECA numeric(8,2) null, constraint PK_SURBERS primary key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, SUR_NUMERO)) go /*==============================================================*/ /* Index: SUR_NUMERO */ /*==============================================================*/ create unique index SUR_NUMERO on SURBERS (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, SUR_NUMERO) go alter table SURBERS add constraint FK_SurberFicha foreign key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) references FICHACAMPO (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) go alter table SURBERS add constraint FK_SurberRivera foreign key (RIV_CODIGO) references RIVERA (RIV_CODIGO) go

Page 68: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 68

alter table SURBERS add constraint FK_SurberFacies foreign key (FAC_CODIGO) references FACIES (FAC_CODIGO) go alter table SURBERS add constraint FK_SurberVegetacion foreign key (VEG_CODIGO) references VEGETACION (VEG_CODIGO) go alter table SURBERS add constraint "FK_Sed-Dominante" foreign key (SED_CODIGO) references SUSTRATO (SUS_CODIGO) go alter table SURBERS add constraint "FK_Sed-Secund" foreign key (SES_CODIGO) references SUSTRATO (SUS_CODIGO) go alter table SURBERS add constraint "FK_Sub-Dominante" foreign key (SCD_CODIGO) references SUSTRATO (SUS_CODIGO) go alter table SURBERS add constraint "FK_Sub-Secund" foreign key (SCS_CODIGO) references SUSTRATO (SUS_CODIGO) go

4.40 Sustrato

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

sus_Codigo Character 1 No sus_Nombre Character 10 Si

Primary Key

- sus_Codigo

Dependencias Objetos que dependen de Sustrato: - Surbers

Objetos de los que depende Sustrato:

Código de creación

alter table SURBERS drop constraint "FK_Sed-Dominante" go alter table SURBERS drop constraint "FK_Sed-Secund"

Page 69: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 69

go alter table SURBERS drop constraint "FK_Sub-Dominante" go alter table SURBERS drop constraint "FK_Sub-Secund" go if exists (select 1 from sysindexes where id = object_id('SUSTRATO') and name = 'SUS_CODIGO' and indid > 0 and indid < 255) drop index SUSTRATO.SUS_CODIGO go if exists (select 1 from sysobjects where id = object_id('SUSTRATO') and type = 'U') drop table SUSTRATO go /*==============================================================*/ /* Table: SUSTRATO */ /*==============================================================*/ create table SUSTRATO ( SUS_CODIGO numeric(1) not null, SUS_NOMBRE character(10) null, constraint PK_SUSTRATO primary key (SUS_CODIGO)) go /*==============================================================*/ /* Index: SUS_CODIGO */ /*==============================================================*/ create unique index SUS_CODIGO on SUSTRATO (SUS_CODIGO) go

4.41 Taxa

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No cam_Numero Numeric 5 No fic_Numero Numeric 5 No sur_Numero Numeric 1 No inv_Codigo Numeric 5 No tax_Cantidad Numeric 3 Si tax_Comentario Texto 16 Si

Page 70: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 70

Primary Key - tip_Codigo - cam_Numero - fic_Numero - sur_Numero - inv_Codigo

Dependencias Objetos que dependen de Taxa:

Objetos de los que depende Taxa: - FichaCampo - Invertebrados

Código de creación

alter table TAXA drop constraint FK_TaxaFichas go alter table TAXA drop constraint FK_TaxaInvertebrados go if exists (select 1 from sysindexes where id = object_id('TAXA') and name = 'INV_CODIGO' and indid > 0 and indid < 255) drop index TAXA.INV_CODIGO go if exists (select 1 from sysobjects where id = object_id('TAXA') and type = 'U') drop table TAXA go /*==============================================================*/ /* Table: TAXA */ /*==============================================================*/ create table TAXA ( TIP_CODIGO numeric(1) not null, CAM_NUMERO numeric(5) not null, FIC_NUMERO numeric(5) not null, SUR_NUMERO numeric(1) not null, INV_CODIGO numeric(5) not null, TAX_CANTIDAD numeric(3) null, TAX_COMENTARIO text null, constraint PK_TAXA primary key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, SUR_NUMERO, INV_CODIGO)) go /*==============================================================*/ /* Index: INV_CODIGO */

Page 71: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 71

/*==============================================================*/ create unique index INV_CODIGO on TAXA (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO, SUR_NUMERO, INV_CODIGO) go alter table TAXA add constraint FK_TaxaFichas foreign key (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) references FICHACAMPO (TIP_CODIGO, CAM_NUMERO, FIC_NUMERO) go alter table TAXA add constraint FK_TaxaInvertebrados foreign key (INV_CODIGO) references INVERTEBRADOS (INV_CODIGO) go

4.42 TipoCampana

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tip_Codigo Numeric 1 No tip_Nombre Character 20 Si

Primary Key

- tip_Codigo

Dependencias Objetos que dependen de TipoCampana: - Campana

Objetos de los que depende TipoCampana:

Código de creación

alter table CAMPANA drop constraint FK_CampanaTipo go if exists (select 1 from sysindexes where id = object_id('TIPOCAMPANA') and name = 'TIP_CODIGO' and indid > 0 and indid < 255) drop index TIPOCAMPANA.TIP_CODIGO go if exists (select 1 from sysobjects where id = object_id('TIPOCAMPANA') and type = 'U') drop table TIPOCAMPANA go /*==============================================================*/

Page 72: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 72

/* Table: TIPOCAMPANA */ /*==============================================================*/ create table TIPOCAMPANA ( TIP_CODIGO numeric(1) not null, TIP_NOMBRE character(20) null, constraint PK_TIPOCAMPANA primary key (TIP_CODIGO)) go /*==============================================================*/ /* Index: TIP_CODIGO */ /*==============================================================*/ create unique index TIP_CODIGO on TIPOCAMPANA (TIP_CODIGO) go

4.43 Turbidez

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

trb_Codigo Numeric 1 No trb_Nombre Character 10 Si

Primary Key

- trb_Codigo

Dependencias Objetos que dependen de Turbidez: - FichaCampo

Objetos de los que depende Turbidez:

Código de creación

alter table FICHACAMPO drop constraint FK_FichaTurbidez go if exists (select 1 from sysindexes where id = object_id('TURBIDEZ') and name = 'TRB_CODIGO' and indid > 0 and indid < 255) drop index TURBIDEZ.TRB_CODIGO go if exists (select 1 from sysobjects where id = object_id('TURBIDEZ') and type = 'U') drop table TURBIDEZ go /*==============================================================*/ /* Table: TURBIDEZ */

Page 73: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 73

/*==============================================================*/ create table TURBIDEZ ( TRB_CODIGO numeric(1) not null, TRB_NOMBRE character(10) null, constraint PK_TURBIDEZ primary key (TRB_CODIGO)) go /*==============================================================*/ /* Index: TRB_CODIGO */ /*==============================================================*/ create unique index TRB_CODIGO on TURBIDEZ (TRB_CODIGO) go

4.44 Turbulencia

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

tur_Codigo Numeric 1 No tur_Nombre Character 10 Si

Primary Key

- tur_Codigo

Dependencias Objetos que dependen de Turbulencia: - FichaCampo

Objetos de los que depende Turbulencia:

Código de creación

alter table FICHACAMPO drop constraint FK_FichaTurbulencia go if exists (select 1 from sysindexes where id = object_id('TURBULENCIA') and name = 'TUR_CODIGO' and indid > 0 and indid < 255) drop index TURBULENCIA.TUR_CODIGO go if exists (select 1 from sysobjects where id = object_id('TURBULENCIA') and type = 'U') drop table TURBULENCIA go /*==============================================================*/ /* Table: TURBULENCIA */ /*==============================================================*/

Page 74: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 74

create table TURBULENCIA ( TUR_CODIGO numeric(1) not null, TUR_NOMBRE character(10) null, constraint PK_TURBULENCIA primary key (TUR_CODIGO)) go /*==============================================================*/ /* Index: TUR_CODIGO */ /*==============================================================*/ create unique index TUR_CODIGO on TURBULENCIA (TUR_CODIGO) go

4.45 Unidades

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

und_Codigo Character 10 No und_Nombre Character 20 Si

Primary Key

- und_Codigo

Dependencias Objetos que dependen de Unidades: - Quimicos

Objetos de los que depende Unidades:

Código de creación

alter table QUIMICOS drop constraint FK_QuimicosUnidades go if exists (select 1 from sysindexes where id = object_id('UNIDADES') and name = 'UND_CODIGO' and indid > 0 and indid < 255) drop index UNIDADES.UND_CODIGO go if exists (select 1 from sysobjects where id = object_id('UNIDADES') and type = 'U') drop table UNIDADES go /*==============================================================*/ /* Table: UNIDADES */ /*==============================================================*/ create table UNIDADES (

Page 75: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 75

UND_CODIGO character(10) not null, UND_NOMBRE character(30) null, constraint PK_UNIDADES primary key (UND_CODIGO)) go /*==============================================================*/ /* Index: UND_CODIGO */ /*==============================================================*/ create unique index UND_CODIGO on UNIDADES (UND_CODIGO) go

4.46 Usuarios

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

usr_Codigo Character 20 No usr_Nombre Character 40 Si usr_Password Character 30 No usr_FechaCreacion Datetime 8 Si

Primary Key

- usr_Codigo

Dependencias Objetos que dependen de Usuarios: - AccesoUsuarios

Objetos de los que depende Usuarios:

Código de creación

alter table ACCESOSUSUARIOS drop constraint FK_AccesosUsuarios go if exists (select 1 from sysindexes where id = object_id('USUARIOS') and name = 'USR_CODIGO' and indid > 0 and indid < 255) drop index USUARIOS.USR_CODIGO go if exists (select 1 from sysobjects where id = object_id('USUARIOS') and type = 'U') drop table USUARIOS go /*==============================================================*/ /* Table: USUARIOS */ /*==============================================================*/

Page 76: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 76

create table USUARIOS ( USR_CODIGO character(20) not null, USR_NOMBRE character(40) null, USR_PASSWORD character(20) null, USR_FECHACREACION datetime null, constraint PK_USUARIOS primary key (USR_CODIGO)) go /*==============================================================*/ /* Index: USR_CODIGO */ /*==============================================================*/ create unique index USR_CODIGO on USUARIOS (USR_CODIGO) go

4.47 Vegetacion

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

veg_Codigo Numeric 1 No veg_nombre Character 25 Si

Primary Key

- veg_Codigo

Dependencias Objetos que dependen de Vegetacion: - Surbers

Objetos de los que depende Vegetacion:

Código de creación

alter table SURBERS drop constraint FK_SurberVegetacion go if exists (select 1 from sysindexes where id = object_id('VEGETACION') and name = 'VGT_CODIGO' and indid > 0 and indid < 255) drop index VEGETACION.VGT_CODIGO go if exists (select 1 from sysobjects where id = object_id('VEGETACION') and type = 'U') drop table VEGETACION go /*==============================================================*/ /* Table: VEGETACION */

Page 77: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 77

/*==============================================================*/ create table VEGETACION ( VEG_CODIGO numeric(1) not null, VEG_NOMBRE character(15) null, constraint PK_VEGETACION primary key (VEG_CODIGO)) go /*==============================================================*/ /* Index: VGT_CODIGO */ /*==============================================================*/ create unique index VGT_CODIGO on VEGETACION (VEG_CODIGO) go

4.48 Viento

Nombre de columna

Tipo de datos Longitud

Permitir valores nulos

vie_Codigo Numeric 1 No vie_Nombre Character 10 Si

Primary Key

- vie_Codigo

Dependencias Objetos que dependen de Viento: - FichaCampo

Objetos de los que depende Viento:

Código de creación

alter table FICHACAMPO drop constraint "FK_Campana-Viento" go if exists (select 1 from sysindexes where id = object_id('VIENTO') and name = 'VIE_CODIGO' and indid > 0 and indid < 255) drop index VIENTO.VIE_CODIGO go if exists (select 1 from sysobjects where id = object_id('VIENTO') and type = 'U') drop table VIENTO go /*==============================================================*/ /* Table: VIENTO */ /*==============================================================*/

Page 78: Manual Técnico BACEQ 1 · 2013. 10. 3. · 4.2 AguasAbiertas 10 4.3 Ancho 11 4.4 Campana 12 4.5 Clase 14 4.6 Cuenca 15 4.7 Estacion 16 4.8 Facies 18 4.9 Familia 19 4.10 FichaCampo

Manual Técnico BACEQ 1.0

Geovanny Terán Página 78

create table VIENTO ( VIE_CODIGO numeric(1) not null, VIE_NOMBRE character(10) null, constraint PK_VIENTO primary key (VIE_CODIGO)) go /*==============================================================*/ /* Index: VIE_CODIGO */ /*==============================================================*/ create unique index VIE_CODIGO on VIENTO (VIE_CODIGO) go