EnVisageOnline/Beta/Database/Schema/Tables/dbo.Fee_Calculation.sql

18 lines
1.5 KiB
Transact-SQL
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Run this script on SQL Server 2008 or later. There may be flaws if running on earlier versions of SQL Server.
*/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Fee_Calculation]') AND type in (N'U'))
DROP TABLE [dbo].[Fee_Calculation]
GO
CREATE TABLE [dbo].[Fee_Calculation] (
[Id] [uniqueidentifier] NOT NULL,
[ExpenditureCategoryId] [uniqueidentifier] NULL,
[MinShot] [int] NOT NULL,
[MaxShot] [int] NOT NULL,
[Quantity] [int] NOT NULL,
CONSTRAINT [PK_FeeCalculationID] PRIMARY KEY CLUSTERED ([Id])
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Fee_Calculation] ADD CONSTRAINT [FK_FeeCalculation_ExpenditureCategory] FOREIGN KEY ([ExpenditureCategoryId]) REFERENCES [dbo].[Expenditure_Category] ([Id])
GO