-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbo.sql
195 lines (167 loc) · 5.58 KB
/
dbo.sql
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*
Navicat SQL Server Data Transfer
Source Server : sqlserv
Source Server Version : 100000
Source Host : localhost:1433
Source Database : test
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version : 100000
File Encoding : 65001
Date: 2012-03-15 17:04:39
*/
-- ----------------------------
-- Table structure for [dbo].[CAB020]
-- ----------------------------
DROP TABLE [dbo].[CAB020]
GO
CREATE TABLE [dbo].[CAB020] (
[CODCABECERA] int NOT NULL IDENTITY(1,1) ,
[CODCLIENTE] int NULL ,
[FECHA] varchar(255) NULL
)
GO
DBCC CHECKIDENT(N'[dbo].[CAB020]', RESEED, 4)
GO
-- ----------------------------
-- Records of CAB020
-- ----------------------------
SET IDENTITY_INSERT [dbo].[CAB020] ON
GO
INSERT INTO [dbo].[CAB020] ([CODCABECERA], [CODCLIENTE], [FECHA]) VALUES (N'1', N'1', N'12-12-12');
GO
INSERT INTO [dbo].[CAB020] ([CODCABECERA], [CODCLIENTE], [FECHA]) VALUES (N'2', N'2', N'12-12-12');
GO
INSERT INTO [dbo].[CAB020] ([CODCABECERA], [CODCLIENTE], [FECHA]) VALUES (N'3', N'1', N'12-13-12');
GO
INSERT INTO [dbo].[CAB020] ([CODCABECERA], [CODCLIENTE], [FECHA]) VALUES (N'4', N'1', N'12-14-12');
GO
SET IDENTITY_INSERT [dbo].[CAB020] OFF
GO
-- ----------------------------
-- Table structure for [dbo].[CLI030]
-- ----------------------------
DROP TABLE [dbo].[CLI030]
GO
CREATE TABLE [dbo].[CLI030] (
[CODCLIENTE] int NOT NULL IDENTITY(1,1) ,
[NOMBRE] varchar(255) NULL ,
[APELLIDO] varchar(255) NULL ,
[CODCIUDAD] int NULL
)
GO
DBCC CHECKIDENT(N'[dbo].[CLI030]', RESEED, 3)
GO
-- ----------------------------
-- Records of CLI030
-- ----------------------------
SET IDENTITY_INSERT [dbo].[CLI030] ON
GO
INSERT INTO [dbo].[CLI030] ([CODCLIENTE], [NOMBRE], [APELLIDO], [CODCIUDAD]) VALUES (N'1', N'juan', N'perez', N'1');
GO
INSERT INTO [dbo].[CLI030] ([CODCLIENTE], [NOMBRE], [APELLIDO], [CODCIUDAD]) VALUES (N'2', N'test', N'test', N'2');
GO
INSERT INTO [dbo].[CLI030] ([CODCLIENTE], [NOMBRE], [APELLIDO], [CODCIUDAD]) VALUES (N'3', N'aDSd', N'dad', N'1');
GO
SET IDENTITY_INSERT [dbo].[CLI030] OFF
GO
-- ----------------------------
-- Table structure for [dbo].[DET010]
-- ----------------------------
DROP TABLE [dbo].[DET010]
GO
CREATE TABLE [dbo].[DET010] (
[CODDETALLE] int NOT NULL IDENTITY(1,1) ,
[CODCABECERA] int NULL ,
[CODPROD] int NULL ,
[CANTIDAD] int NULL
)
GO
DBCC CHECKIDENT(N'[dbo].[DET010]', RESEED, 8)
GO
-- ----------------------------
-- Records of DET010
-- ----------------------------
SET IDENTITY_INSERT [dbo].[DET010] ON
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'1', N'1', N'1', N'12');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'2', N'1', N'2', N'13');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'3', N'1', N'5', N'10');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'4', N'2', N'1', N'5');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'5', N'3', N'2', N'5');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'6', N'3', N'3', N'11');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'7', N'3', N'4', N'9');
GO
INSERT INTO [dbo].[DET010] ([CODDETALLE], [CODCABECERA], [CODPROD], [CANTIDAD]) VALUES (N'8', N'4', N'5', N'45');
GO
SET IDENTITY_INSERT [dbo].[DET010] OFF
GO
-- ----------------------------
-- Table structure for [dbo].[PROD010]
-- ----------------------------
DROP TABLE [dbo].[PROD010]
GO
CREATE TABLE [dbo].[PROD010] (
[CODPROD] int NOT NULL IDENTITY(1,1) ,
[NOMBRE] varchar(255) NULL ,
[PRECIO] decimal(10,2) NULL ,
[IVA] int NULL
)
GO
DBCC CHECKIDENT(N'[dbo].[PROD010]', RESEED, 5)
GO
-- ----------------------------
-- Records of PROD010
-- ----------------------------
SET IDENTITY_INSERT [dbo].[PROD010] ON
GO
INSERT INTO [dbo].[PROD010] ([CODPROD], [NOMBRE], [PRECIO], [IVA]) VALUES (N'1', N'MESA', N'11.56', N'12');
GO
INSERT INTO [dbo].[PROD010] ([CODPROD], [NOMBRE], [PRECIO], [IVA]) VALUES (N'2', N'SILLA', N'12.40', N'12');
GO
INSERT INTO [dbo].[PROD010] ([CODPROD], [NOMBRE], [PRECIO], [IVA]) VALUES (N'3', N'MESA CENTRO', N'15.99', N'12');
GO
INSERT INTO [dbo].[PROD010] ([CODPROD], [NOMBRE], [PRECIO], [IVA]) VALUES (N'4', N'SILLON', N'13.23', N'12');
GO
INSERT INTO [dbo].[PROD010] ([CODPROD], [NOMBRE], [PRECIO], [IVA]) VALUES (N'5', N'SILLA RELAX', N'14.22', N'12');
GO
SET IDENTITY_INSERT [dbo].[PROD010] OFF
GO
-- ----------------------------
-- Indexes structure for table CAB020
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table [dbo].[CAB020]
-- ----------------------------
ALTER TABLE [dbo].[CAB020] ADD PRIMARY KEY ([CODCABECERA])
GO
-- ----------------------------
-- Indexes structure for table CLI030
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table [dbo].[CLI030]
-- ----------------------------
ALTER TABLE [dbo].[CLI030] ADD PRIMARY KEY ([CODCLIENTE])
GO
-- ----------------------------
-- Indexes structure for table DET010
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table [dbo].[DET010]
-- ----------------------------
ALTER TABLE [dbo].[DET010] ADD PRIMARY KEY ([CODDETALLE])
GO
-- ----------------------------
-- Indexes structure for table PROD010
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table [dbo].[PROD010]
-- ----------------------------
ALTER TABLE [dbo].[PROD010] ADD PRIMARY KEY ([CODPROD])
GO