USE [KSDK_157] GO /****** Object: Table [fs].[Performance] Script Date: 05/08/2015 12:14:10 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [fs].[Performance]( [Id] [int] IDENTITY(1,1) NOT NULL, [FundId] [int] NOT NULL, [ReportDate] [datetime] NOT NULL, [ProductId] [int] NOT NULL, [BasisId] [int] NOT NULL, [PeriodValue] [int] NULL, [PeriodUnit] [varchar](10) NULL, [PerformanceValue1] [decimal](10, 5) NULL, [Performancevalue2] [float] NULL, [Currency] [varchar](500) NULL, [FileName] [varchar](500) NULL, [Note] [varchar](500) NULL, [Range] [varchar](50) NULL, [CreatedDate] [datetime] NULL CONSTRAINT [DF_Performance_CreatedDate] DEFAULT (getdate()), CONSTRAINT [PK_Performance] 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] GO SET ANSI_PADDING ON GO ALTER TABLE [fs].[Performance] WITH CHECK ADD CONSTRAINT [FK_Performance_Basis] FOREIGN KEY([BasisId]) REFERENCES [fs].[Basis] ([Id]) GO ALTER TABLE [fs].[Performance] CHECK CONSTRAINT [FK_Performance_Basis] GO ALTER TABLE [fs].[Performance] WITH CHECK ADD CONSTRAINT [FK_Performance_Fund] FOREIGN KEY([FundId]) REFERENCES [fs].[Fund] ([FundId]) GO ALTER TABLE [fs].[Performance] CHECK CONSTRAINT [FK_Performance_Fund] GO ALTER TABLE [fs].[Performance] WITH CHECK ADD CONSTRAINT [FK_Performance_Product] FOREIGN KEY([ProductId]) REFERENCES [fs].[Product] ([Id]) GO ALTER TABLE [fs].[Performance] CHECK CONSTRAINT [FK_Performance_Product] GO