1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
CREATE TABLE [dbo].[fr_divers](
[fd_id] [int] IDENTITY(1,1) NOT NULL,
[fd_dossier] [int] NOT NULL,
[fd_frais] [nvarchar](50) COLLATE French_CI_AS NULL,
[fd_designation] [nvarchar](50) COLLATE French_CI_AS NULL,
[fd_quantite] [real] NULL,
[fd_prix_u] [real] NULL,
[fd_prix_t] AS ([fd_quantite] * [fd_prix_u]),
[fd_date] [datetime] NOT NULL,
[fd_semaine] AS (datepart(week,[fd_date])),
CONSTRAINT [PK_fr_divers] PRIMARY KEY CLUSTERED
(
[fd_id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[fr_four](
[ff_id] [int] IDENTITY(1,1) NOT NULL,
[ff_dossier] [int] NOT NULL,
[ff_frais] [nvarchar](50) COLLATE French_CI_AS NULL,
[ff_designation] [nvarchar](50) COLLATE French_CI_AS NULL,
[ff_quantite] [real] NULL,
[ff_prix_u] [real] NULL,
[ff_prix_t] AS ([ff_quantite] * [ff_prix_u]),
[ff_date] [datetime] NOT NULL,
[ff_semaine] AS (datepart(week,[ff_date])),
CONSTRAINT [PK_fr_four] PRIMARY KEY CLUSTERED
(
[ff_id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[fr_strait](
[fs_id] [int] IDENTITY(1,1) NOT NULL,
[fs_dossier] [int] NOT NULL,
[fs_frais] [nvarchar](50) COLLATE French_CI_AS NULL,
[fs_designation] [nvarchar](50) COLLATE French_CI_AS NULL,
[fs_quantite] [real] NULL,
[fs_prix_u] [real] NULL,
[fs_prix_t] AS ([fs_quantite] * [fs_prix_u]),
[fs_date] [datetime] NOT NULL,
[fs_semaine] AS (datepart(week,[fs_date])),
CONSTRAINT [PK_fr_strait] PRIMARY KEY CLUSTERED
(
[fs_id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[sc_heures](
[hr_id] [int] IDENTITY(1,1) NOT NULL,
[hr_dossier] [int] NOT NULL,
[hr_semaine] [int] NOT NULL,
[hr_nom] [nvarchar](50) COLLATE French_CI_AS NOT NULL,
[hr_lundi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_lundi] DEFAULT (0),
[hr_mardi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_mardi] DEFAULT (0),
[hr_mercredi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_mercredi] DEFAULT (0),
[hr_jeudi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_jeudi] DEFAULT (0),
[hr_vendredi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_vendredi] DEFAULT (0),
[hr_samedi] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_samedi] DEFAULT (0),
[hr_dimanche] [real] NOT NULL CONSTRAINT [DF_sc_heures_hr_dimanche] DEFAULT (0),
[hr_total] AS ([hr_lundi] + [hr_mardi] + [hr_mercredi] + [hr_jeudi] + [hr_vendredi] + [hr_samedi] + [hr_dimanche]),
CONSTRAINT [PK_sc_heures] PRIMARY KEY CLUSTERED
(
[hr_id] ASC
) ON [PRIMARY],
CONSTRAINT [UN_sc_heures] UNIQUE NONCLUSTERED
(
[hr_dossier] ASC,
[hr_semaine] ASC,
[hr_nom] ASC
) ON [PRIMARY]
) ON [PRIMARY] |
Partager