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 74 75 76 77 78
| USE [test]
GO
/****** Object: Table [dbo].[PAYS] Script Date: 07/31/2008 22:39:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PAYS](
[PAYS_ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[PAYS_NOM] [nchar](50) NULL,
CONSTRAINT [PK_PAYS] PRIMARY KEY CLUSTERED
(
[PAYS_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]
USE [test]
GO
/****** Object: Table [dbo].[REGION] Script Date: 07/31/2008 22:42:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[REGION](
[REGION_ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[PAYS_ID] [numeric](18, 0) NULL,
[REGION_NOM] [nchar](50) NULL,
CONSTRAINT [PK_REGION] PRIMARY KEY CLUSTERED
(
[REGION_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]
USE [test]
GO
/****** Object: Table [dbo].[DEPARTEMENT] Script Date: 07/31/2008 22:42:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DEPARTEMENT](
[DEP_ID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[REGION_ID] [numeric](18, 0) NULL,
[DEP_NOM] [nchar](50) NULL,
CONSTRAINT [PK_DEPARTEMENT] PRIMARY KEY CLUSTERED
(
[DEP_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]
DECLARE @P INT, @R INT
INSERT INTO PAYS (PAYS_NOM) VALUES ('FRANCE'); SET @P = SCOPE_IDENTITY();
INSERT INTO REGION (PAYS_ID, REGION_NOM) VALUES (@P, 'NORMANDIE'); SET @R = SCOPE_IDENTITY();
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'CALVADOS');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'ORNE');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'MANCHE');
INSERT INTO REGION (PAYS_ID, REGION_NOM) VALUES (@P, 'PACA'); SET @R = SCOPE_IDENTITY();
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'BDR');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'VAR');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'ALPES HP');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'ALPES MAR');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'HTES ALPES');
INSERT INTO PAYS (PAYS_NOM) VALUES ('ENGLAND'); SET @P = SCOPE_IDENTITY();
INSERT INTO REGION (PAYS_ID, REGION_NOM) VALUES (@P, 'GLOUCESTERSHIRE'); SET @R = SCOPE_IDENTITY();
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'GLOUCESTERSHIRE');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'SOUTH GLOUCESTERSHIRE');
INSERT INTO REGION (PAYS_ID, REGION_NOM) VALUES (@P, 'SOMERSET'); SET @R = SCOPE_IDENTITY();
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'BATH AND NORTH EAST SOMERSET');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'NORTH SOMERSET');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'BRISTOL');
INSERT INTO DEPARTEMENT (REGION_ID, DEP_NOM) VALUES (@R, 'SOMERSET'); |
Partager