Respuesta: Optimizar consulta SQL esta es la estructura de la tabla cencostos:
create table cencostos(
cod_centro varchar(255)
);
esta es la estructura de la tabla cuentas:
create table cuentas(
numero varchar(255)
);
esta es la estructura de la tabla CuentasCeco:
create table CuentasCeco(
Expr1 varchar(24),
Expr2 varchar(102),
Expr3 varchar(3),
Expr4 varchar(4),
Expr5 varchar(7)
)
esta es la estructura de la tabla gl00100:
CREATE TABLE [dbo].[GL00100](
[ACTINDX] [int] NOT NULL,
[ACTNUMBR_1] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_2] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_3] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_4] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_5] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_6] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_7] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_8] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_9] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTNUMBR_10] [char](7) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACTALIAS] [char](21) COLLATE Modern_Spanish_CI_AS NOT NULL,
[MNACSGMT] [char](67) COLLATE Modern_Spanish_CI_AS NOT NULL,
[ACCTTYPE] [smallint] NOT NULL,
[ACTDESCR] [char](51) COLLATE Modern_Spanish_CI_AS NOT NULL,
[PSTNGTYP] [smallint] NOT NULL,
[ACCATNUM] [smallint] NOT NULL,
[ACTIVE] [tinyint] NOT NULL,
[TPCLBLNC] [smallint] NOT NULL,
[DECPLACS] [smallint] NOT NULL,
[FXDORVAR] [smallint] NOT NULL,
[BALFRCLC] [smallint] NOT NULL,
[DSPLKUPS] [binary](4) NOT NULL,
[CNVRMTHD] [smallint] NOT NULL,
[HSTRCLRT] [numeric](19, 7) NOT NULL,
[NOTEINDX] [numeric](19, 5) NOT NULL,
[CREATDDT] [datetime] NOT NULL,
[MODIFDT] [datetime] NOT NULL,
[USERDEF1] [char](21) COLLATE Modern_Spanish_CI_AS NOT NULL,
[USERDEF2] [char](21) COLLATE Modern_Spanish_CI_AS NOT NULL,
[PostSlsIn] [smallint] NOT NULL,
[PostIvIn] [smallint] NOT NULL,
[PostPurchIn] [smallint] NOT NULL,
[PostPRIn] [smallint] NOT NULL,
[ADJINFL] [tinyint] NOT NULL,
[INFLAREV] [int] NOT NULL,
[INFLAEQU] [int] NOT NULL,
[ACCTENTR] [tinyint] NOT NULL,
[USRDEFS1] [char](31) COLLATE Modern_Spanish_CI_AS NOT NULL,
[USRDEFS2] [char](31) COLLATE Modern_Spanish_CI_AS NOT NULL,
[DEX_ROW_ID] [int] NOT NULL
) ON [PRIMARY]
estas en lo correcto, esa es la combinación, la aplicación importa dos archivos de texto con información de cuentas y centros de costos, luego eso se combina con la tabla gl00100, y de alli se importa otro archivo de texto, que es el producto final que arroja el paquete
Última edición por carlos-paredes; 02/12/2008 a las 12:00 |