Sei sulla pagina 1di 6

USE [Prueba]

GO
/****** Object: Table [dbo].[Especificacion] Script Date: 11/10/2014 17:28:5
8 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Especificacion](
[EspecificacionId] [varchar](6) NOT NULL,
[Descripcion] [varchar](50) NULL,
CONSTRAINT [PK_Especificacion] PRIMARY KEY CLUSTERED
(
[EspecificacionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[EspecificacionPP] Script Date: 11/10/2014 17:28
:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EspecificacionPP](
[EspecificacionPPId] [varchar](6) NOT NULL,
[EspecificacionProductoId] [varchar](6) NOT NULL,
[ProductoProformaId] [varchar](6) NULL,
[ValorEspecificacionId] [varchar](6) NULL,
[Cantidad] [int] NULL,
[Precio] [numeric](9, 2) NULL,
CONSTRAINT [PK_EspecificacionPP_1] PRIMARY KEY CLUSTERED
(
[EspecificacionPPId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[EspecificacionProducto] Script Date: 11/10/2014
17:28:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EspecificacionProducto](
[EspecificacionProductoId] [varchar](6) NOT NULL,
[EspecificacionId] [varchar](6) NULL,
[ProductoId] [varchar](6) NULL,
CONSTRAINT [PK_EspecificacionProducto] PRIMARY KEY CLUSTERED
(
[EspecificacionProductoId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Producto] Script Date: 11/10/2014 17:28:58 ****
**/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Producto](
[ProductoId] [varchar](6) NOT NULL,
[Descripcion] [varchar](50) NULL,
CONSTRAINT [PK_Producto] PRIMARY KEY CLUSTERED
(
[ProductoId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[ProductoProforma] Script Date: 11/10/2014 17:28
:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ProductoProforma](
[ProductoProformaId] [varchar](6) NOT NULL,
[ProductoId] [varchar](6) NULL,
[ProformaId] [varchar](10) NULL,
CONSTRAINT [PK_ProductoProforma] PRIMARY KEY CLUSTERED
(
[ProductoProformaId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Proforma] Script Date: 11/10/2014 17:28:58 ****
**/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Proforma](
[ProformaId] [varchar](10) NOT NULL,
[ClienteId] [varchar](6) NULL,
CONSTRAINT [PK_Proforma] PRIMARY KEY CLUSTERED
(
[ProformaId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[ValorEspecificacion] Script Date: 11/10/2014 17
:28:58 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ValorEspecificacion](
[ValorEspecificacionId] [varchar](6) NOT NULL,
[EspecificacionId] [varchar](6) NOT NULL,
[Valor] [varchar](50) NULL,
CONSTRAINT [PK_ValorEspecificacion_1] PRIMARY KEY CLUSTERED
(
[ValorEspecificacionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLO
W_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Especificacion] ([EspecificacionId], [Descripcion]) VALUES (N'0000
01', N'COLOR')
GO
INSERT [dbo].[Especificacion] ([EspecificacionId], [Descripcion]) VALUES (N'0000
02', N'TALLA')
GO
INSERT [dbo].[Especificacion] ([EspecificacionId], [Descripcion]) VALUES (N'0000
03', N'CATEGORIA')
GO
INSERT [dbo].[Especificacion] ([EspecificacionId], [Descripcion]) VALUES (N'0000
04', N'MARCA')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000001', N'000001', N'000001')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000002', N'000002', N'000001')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000003', N'000003', N'000001')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000004', N'000004', N'000001')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000006', N'000002', N'000003')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000007', N'000003', N'000003')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000008', N'000004', N'000003')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000009', N'000001', N'000004')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000010', N'000002', N'000004')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000011', N'000003', N'000004')
GO
INSERT [dbo].[EspecificacionProducto] ([EspecificacionProductoId], [Especificaci
onId], [ProductoId]) VALUES (N'000012', N'000004', N'000004')
GO
INSERT [dbo].[Producto] ([ProductoId], [Descripcion]) VALUES (N'000001', N'POLOS
LICRA PER')
GO
INSERT [dbo].[Producto] ([ProductoId], [Descripcion]) VALUES (N'000002', N'CAMIS
ETAS SELECCION ECUATORIANA PER')
GO
INSERT [dbo].[Producto] ([ProductoId], [Descripcion]) VALUES (N'000003', N'CAMIS
ETA DEPORTIVA')
GO
INSERT [dbo].[Producto] ([ProductoId], [Descripcion]) VALUES (N'000004', N'PANTA
LONETA')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000001', N'000003', N'NIOS')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000002', N'000003', N'CABALLEROS')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000003', N'000003', N'DAMAS')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000004', N'000001', N'NEGRO')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000005', N'000001', N'BLANCO')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000006', N'000002', N'S')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000007', N'000002', N'M')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000008', N'000002', N'L')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000009', N'000004', N'WINDS')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000010', N'000004', N'YOL')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000011', N'000004', N'TAYSIR')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000012', N'000004', N'LA FABRICA')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000013', N'000003', N'DEPORTIVA')
GO
INSERT [dbo].[ValorEspecificacion] ([ValorEspecificacionId], [EspecificacionId],
[Valor]) VALUES (N'000014', N'000002', N'XL')
GO
ALTER TABLE [dbo].[EspecificacionPP] WITH CHECK ADD CONSTRAINT [FK_Especificac
ionPP_EspecificacionProducto] FOREIGN KEY([EspecificacionProductoId])
REFERENCES [dbo].[EspecificacionProducto] ([EspecificacionProductoId])
GO
ALTER TABLE [dbo].[EspecificacionPP] CHECK CONSTRAINT [FK_EspecificacionPP_Espec
ificacionProducto]
GO
ALTER TABLE [dbo].[EspecificacionPP] WITH CHECK ADD CONSTRAINT [FK_Especificac
ionPP_ProductoProforma] FOREIGN KEY([ProductoProformaId])
REFERENCES [dbo].[ProductoProforma] ([ProductoProformaId])
GO
ALTER TABLE [dbo].[EspecificacionPP] CHECK CONSTRAINT [FK_EspecificacionPP_Produ
ctoProforma]
GO
ALTER TABLE [dbo].[EspecificacionPP] WITH CHECK ADD CONSTRAINT [FK_Especificac
ionPP_ValorEspecificacion] FOREIGN KEY([ValorEspecificacionId])
REFERENCES [dbo].[ValorEspecificacion] ([ValorEspecificacionId])
GO
ALTER TABLE [dbo].[EspecificacionPP] CHECK CONSTRAINT [FK_EspecificacionPP_Valor
Especificacion]
GO
ALTER TABLE [dbo].[EspecificacionProducto] WITH CHECK ADD CONSTRAINT [FK_Espec
ificacionProducto_Especificacion] FOREIGN KEY([EspecificacionId])
REFERENCES [dbo].[Especificacion] ([EspecificacionId])
GO
ALTER TABLE [dbo].[EspecificacionProducto] CHECK CONSTRAINT [FK_EspecificacionPr
oducto_Especificacion]
GO
ALTER TABLE [dbo].[EspecificacionProducto] WITH CHECK ADD CONSTRAINT [FK_Espec
ificacionProducto_Producto] FOREIGN KEY([ProductoId])
REFERENCES [dbo].[Producto] ([ProductoId])
GO
ALTER TABLE [dbo].[EspecificacionProducto] CHECK CONSTRAINT [FK_EspecificacionPr
oducto_Producto]
GO
ALTER TABLE [dbo].[ProductoProforma] WITH CHECK ADD CONSTRAINT [FK_ProductoPro
forma_Producto] FOREIGN KEY([ProductoId])
REFERENCES [dbo].[Producto] ([ProductoId])
GO
ALTER TABLE [dbo].[ProductoProforma] CHECK CONSTRAINT [FK_ProductoProforma_Produ
cto]
GO
ALTER TABLE [dbo].[ProductoProforma] WITH CHECK ADD CONSTRAINT [FK_ProductoPro
forma_Proforma] FOREIGN KEY([ProformaId])
REFERENCES [dbo].[Proforma] ([ProformaId])
GO
ALTER TABLE [dbo].[ProductoProforma] CHECK CONSTRAINT [FK_ProductoProforma_Profo
rma]
GO
ALTER TABLE [dbo].[ValorEspecificacion] WITH CHECK ADD CONSTRAINT [FK_ValorEsp
ecificacion_Especificacion] FOREIGN KEY([EspecificacionId])
REFERENCES [dbo].[Especificacion] ([EspecificacionId])
GO
ALTER TABLE [dbo].[ValorEspecificacion] CHECK CONSTRAINT [FK_ValorEspecificacion
_Especificacion]
GO

Potrebbero piacerti anche