/* DIR_GEN */ 
IF OBJECT_ID('dbo.dir_gen','U') IS NOT NULL DROP TABLE dbo.dir_gen; 
CREATE TABLE [dbo].[dir_gen](																				
	[_ID_] [int] IDENTITY(1,1) NOT NULL,																	
	[NUMERO] [int] NOT NULL,																						
	[SYSNAME] [text] NOT NULL,																					
	[EOD] [int] NULL,																										
	[EOX] [int] NULL,																										
	[FLAGS] [int] NULL,																									
	[LENR] [int] NULL,																									
	[DES] [text] NULL,																									
	[CALC] [text] NULL,																									
	[GENPROMPT] [text] NULL,																						
PRIMARY KEY CLUSTERED																								
	([_ID_] ASC) WITH																											
	(PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]	
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];															

/* TRC_GEN */ 
IF OBJECT_ID('dbo.trc_gen','U') IS NOT NULL DROP TABLE dbo.trc_gen; 
CREATE TABLE [dbo].[trc_gen](																				
	[_ID_] [int] IDENTITY(1,1) NOT NULL,																
	[NFields] [int] NOT NULL,																						
	[SortFd] [text] NULL,																								
	[NKeys] [int] NOT NULL,																							
	[logicname] [int] NOT NULL																					
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];

/* TRC_KEYDES */ 
IF OBJECT_ID('dbo.trc_keydes','U') IS NOT NULL DROP TABLE dbo.trc_keydes; 
CREATE TABLE [dbo].[trc_keydes](																					
	[_ID_] [int] IDENTITY(1,1) NOT NULL,																			
	[DupKeys] [int] NOT NULL,																									
	[NkFields] [int] NOT NULL,																								
	[FieldSeq] [text] NULL,																										
	[FromCh] [text] NULL,																											
	[ToCh] [text] NULL,																												
	[logicname] [int] NOT NULL																								
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];

/* TRC_RECFDES */ 
IF OBJECT_ID('dbo.trc_recfdes','U') IS NOT NULL DROP TABLE dbo.trc_recfdes;	
CREATE TABLE [dbo].[trc_recfdes](																						
	[_ID_] [int] IDENTITY(1,1) NOT NULL,
	[NumField] [int] NOT NULL,
	[Name] [text] NOT NULL,																											
	[TypeF] [int] NOT NULL,																											
	[Len] [int] NULL,																														
	[Dec] [int] NULL,																														
	[RecOff] [int] NULL,																												
	[logicname] [int] NOT NULL																									
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];