V.1. Application et
Implémentation du Système
Dans cette partie du travail, nous avons choisis comme
Système de gestion de base de données réparties pour la
configuration de notre réplication, le SQL Server Management Studio 2008
et comme outil d'application cliente un des produits de Microsoft Visual Studio
qui est le C Sharp (C#).
Code de génération de la Base de
données Globale
USE [CENI-KIN]
GO
/****** Object: Table [dbo].[Centre_enrol] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Centre_enrol](
[code_ce] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[president] [varchar](20) NULL,
[code_qg] [varchar](10) NULL,
[code_adr] [varchar](10) NULL,
[code_scc] [varchar](10) NULL,
[code_tv] [varchar](50) NULL,
CONSTRAINT [PK_Centre_enrol] PRIMARY KEY CLUSTERED
(
[code_ce] 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 OFF
GO
/****** Object: Table [dbo].[Categorie] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Categorie](
[code_cat] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[code_adr] [nchar](10) NULL,
CONSTRAINT [PK_Adresse_Urbaine] PRIMARY KEY CLUSTERED
(
[code_cat] 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 OFF
GO
/****** Object: Table [dbo].[Adresse] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Adresse](
[code_adr] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
CONSTRAINT [PK_Adresse_Rurale] PRIMARY KEY CLUSTERED
(
[code_adr] 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 OFF
GO
/****** Object: Table [dbo].[Province] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Province](
[code_prov] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
CONSTRAINT [PK_Province] PRIMARY KEY CLUSTERED
(
[code_prov] 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 OFF
GO
/****** Object: Table [dbo].[Personnes] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Personnes](
[matr] [varchar](25) NOT NULL,
[nom] [varchar](20) NULL,
[postnom] [varchar](20) NULL,
[prenom] [varchar](20) NULL,
[sexe] [varchar](20) NULL,
[datenais] [varchar](20) NULL,
[nom_pere] [varchar](20) NULL,
[nom_mere] [varchar](20) NULL,
[date_enrol] [varchar](20) NULL,
[lieu] [varchar](50) NULL,
[photo] [image] NULL,
[empr_droit] [image] NULL,
[empr_gauch] [image] NULL,
[code_adr] [varchar](10) NULL,
[code_villa] [varchar](10) NULL,
[code_ce] [varchar](10) NULL,
[code_cat] [varchar](10) NULL,
CONSTRAINT [PK_Personnes] PRIMARY KEY CLUSTERED
(
[matr] 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]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Nvel_Province] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Nvel_Province](
[code_nprov] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[code_prov] [varchar](10) NULL,
CONSTRAINT [PK_Nvel_Province] PRIMARY KEY CLUSTERED
(
[code_nprov] 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 OFF
GO
/****** Object: Table [dbo].[Territoire] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Territoire](
[code_tv] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[type] [varchar](20) NULL,
[code_nprov] [varchar](10) NULL,
CONSTRAINT [PK_Territoire] PRIMARY KEY CLUSTERED
(
[code_tv] 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 OFF
GO
/****** Object: Table [dbo].[Secteur] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Secteur](
[code_scc] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[type] [varchar](20) NULL,
[code_territ] [varchar](10) NULL,
CONSTRAINT [PK_Secteur] PRIMARY KEY CLUSTERED
(
[code_scc] 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 OFF
GO
/****** Object: Table [dbo].[Groupement] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Groupement](
[code_qg] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[type] [varchar](20) NULL,
[code_scc] [varchar](10) NULL,
CONSTRAINT [PK_Groupement] PRIMARY KEY CLUSTERED
(
[code_qg] 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 OFF
GO
/****** Object: Table [dbo].[Village] Script Date:
02/21/2012 12:09:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Village](
[code_villa] [varchar](10) NOT NULL,
[description] [varchar](20) NULL,
[code_qg] [varchar](10) NULL,
CONSTRAINT [PK_Village] PRIMARY KEY CLUSTERED
(
[code_villa] 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 OFF
GO
/****** Object: ForeignKey [FK_Groupement_Secteur] Script
Date: 02/21/2012 12:09:17 ******/
ALTER TABLE [dbo].[Groupement] WITH CHECK ADD CONSTRAINT
[FK_Groupement_Secteur] FOREIGN KEY([code_scc])
REFERENCES [dbo].[Secteur] ([code_scc])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Groupement] CHECK CONSTRAINT
[FK_Groupement_Secteur]
GO
/****** Object: ForeignKey [FK_Nvel_Province_Province]
Script Date: 02/21/2012 12:09:17 ******/
ALTER TABLE [dbo].[Nvel_Province] WITH CHECK ADD CONSTRAINT
[FK_Nvel_Province_Province] FOREIGN KEY([code_prov])
REFERENCES [dbo].[Province] ([code_prov])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Nvel_Province] CHECK CONSTRAINT
[FK_Nvel_Province_Province]
GO
/****** Object: ForeignKey [FK_Secteur_Territoire] Script
Date: 02/21/2012 12:09:17 ******/
ALTER TABLE [dbo].[Secteur] WITH CHECK ADD CONSTRAINT
[FK_Secteur_Territoire] FOREIGN KEY([code_territ])
REFERENCES [dbo].[Territoire] ([code_tv])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Secteur] CHECK CONSTRAINT
[FK_Secteur_Territoire]
GO
/****** Object: ForeignKey [FK_Territoire_Nvel_Province]
Script Date: 02/21/2012 12:09:17 ******/
ALTER TABLE [dbo].[Territoire] WITH CHECK ADD CONSTRAINT
[FK_Territoire_Nvel_Province] FOREIGN KEY([code_nprov])
REFERENCES [dbo].[Nvel_Province] ([code_nprov])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Territoire] CHECK CONSTRAINT
[FK_Territoire_Nvel_Province]
GO
/****** Object: ForeignKey [FK_Village_Groupement] Script
Date: 02/21/2012 12:09:17 ******/
ALTER TABLE [dbo].[Village] WITH CHECK ADD CONSTRAINT
[FK_Village_Groupement] FOREIGN KEY([code_qg])
REFERENCES [dbo].[Groupement] ([code_qg])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Village] CHECK CONSTRAINT
[FK_Village_Groupement]
GO
Images de mes Bases de données et tables ainsi
de ma Configuration
|