ALTER TABLE Indices_Mov DROP CONSTRAINT FK_INDM_Indices
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Indices_Mov') AND type in (N'U'))
	DROP TABLE Indices_Mov
GO


CREATE TABLE Indices_Mov(
	Id_Mov int IDENTITY(1,1) NOT NULL,
	Id_Indice smallint NULL,
	Fecha datetime NULL,
	Valor decimal(16, 4) NULL,
	Color char(1) NULL,
 CONSTRAINT PK_INDM_PorId PRIMARY KEY CLUSTERED (	Id_Mov) 
) 
GO

ALTER TABLE Indices_Mov  WITH CHECK ADD  CONSTRAINT FK_INDM_Indices FOREIGN KEY(Id_Indice)
	REFERENCES Indices (Id_Indice)
GO

ALTER TABLE Indices_Mov CHECK CONSTRAINT FK_INDM_Indices
GO


