際際滷

際際滷Share a Scribd company logo
USE [pventa]
GO
/* Object: Table [dbo].[users]
Script Date: 09/08/2011 17:27:43 */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[users](
[user_login] [nvarchar](50) NOT NULL,
[user_password] [nvarchar](250) NULL,
[nombre] [nvarchar](150) NULL,
[activo] [bit] NOT NULL,
[ventas] [bit] NOT NULL,
[reportes] [bit] NOT NULL,
[administrar] [bit] NOT NULL,
[fecha_registro] [datetime] NOT NULL,
CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED
(
[user_login] 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
/* Object: Table [dbo].[unidad_medida]
Script Date: 09/08/2011 17:27:43
*/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[unidad_medida](
[id_unidad_medida] [smallint] NOT NULL,
[unidad_medida] [nvarchar](150) NULL,
CONSTRAINT [PK_unidad_medida] PRIMARY KEY CLUSTERED
(
[id_unidad_medida] 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
/* Object: Table [dbo].[productos]
Script Date: 09/08/2011 17:27:43
*/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[productos](
[id_producto] [nvarchar](50) NOT NULL,
[producto] [nvarchar](250) NULL,
[id_unidad_medida] [smallint] NULL,
[p_compra] [float] NULL,
[p_venta] [float] NULL,
[existencia] [float] NULL,
CONSTRAINT [PK_productos] PRIMARY KEY CLUSTERED
(
[id_producto] 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
/* Object: Table [dbo].[venta]
Script Date: 09/08/2011 17:27:43 */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[venta](
[id_venta] [int] IDENTITY(1,1) NOT NULL,
[fecha_registro] [datetime] NOT NULL,
[user_login] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_venta] PRIMARY KEY CLUSTERED
(
[id_venta] 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
/* Object: Table [dbo].[venta_detalle_tmp]
Script Date: 09/08/2011
17:27:43 */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[venta_detalle_tmp](
[id_venta_detalle_tmp] [int] IDENTITY(1,1) NOT NULL,
[id_producto] [nvarchar](50) NOT NULL,
[cantidad] [float] NOT NULL,
[user_login] [nvarchar](50) NOT NULL,
[p_venta] [float] NOT NULL,
CONSTRAINT [PK_venta_detalle_tmp] PRIMARY KEY CLUSTERED
(
[id_venta_detalle_tmp] 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
/* Object: Table [dbo].[venta_detalle]
Script Date: 09/08/2011 17:27:43
*/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[venta_detalle](
[id_venta_detalle] [int] IDENTITY(1,1) NOT NULL,
[id_venta] [int] NOT NULL,
[id_producto] [nvarchar](50) NOT NULL,
[cantidad] [float] NOT NULL,
[p_venta] [float] NOT NULL,
CONSTRAINT [PK_venta_detalle] PRIMARY KEY CLUSTERED
(
[id_venta_detalle] 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
/* Object: Default [DF_users_fecha_registro]
Script Date: 09/08/2011
17:27:43 */
ALTER TABLE [dbo].[users] ADD CONSTRAINT [DF_users_fecha_registro] DEFAULT
(getdate()) FOR [fecha_registro]
GO
/* Object: Default [DF_venta_fecha_registro]
Script Date: 09/08/2011
17:27:43 */
ALTER TABLE [dbo].[venta] ADD CONSTRAINT [DF_venta_fecha_registro] DEFAULT
(getdate()) FOR [fecha_registro]
GO
/* Object: ForeignKey [FK_productos_unidad_medida]
Script Date:
09/08/2011 17:27:43 */
ALTER TABLE [dbo].[productos] WITH CHECK ADD CONSTRAINT
[FK_productos_unidad_medida] FOREIGN KEY([id_unidad_medida])
REFERENCES [dbo].[unidad_medida] ([id_unidad_medida])
GO
ALTER TABLE [dbo].[productos] CHECK CONSTRAINT [FK_productos_unidad_medida]
GO
/* Object: ForeignKey [FK_venta_users]
Script Date: 09/08/2011 17:27:43
*/
ALTER TABLE [dbo].[venta] WITH CHECK ADD CONSTRAINT [FK_venta_users] FOREIGN
KEY([user_login])
REFERENCES [dbo].[users] ([user_login])
GO
ALTER TABLE [dbo].[venta] CHECK CONSTRAINT [FK_venta_users]
GO
/* Object: ForeignKey [FK_venta_detalle_productos]
Script Date:
09/08/2011 17:27:43 */
ALTER TABLE [dbo].[venta_detalle] WITH CHECK ADD CONSTRAINT
[FK_venta_detalle_productos] FOREIGN KEY([id_producto])
REFERENCES [dbo].[productos] ([id_producto])
GO
ALTER TABLE [dbo].[venta_detalle] CHECK CONSTRAINT [FK_venta_detalle_productos]
GO
/* Object: ForeignKey [FK_venta_detalle_venta]
Script Date: 09/08/2011
17:27:43 */
ALTER TABLE [dbo].[venta_detalle] WITH CHECK ADD CONSTRAINT
[FK_venta_detalle_venta] FOREIGN KEY([id_venta])
REFERENCES [dbo].[venta] ([id_venta])
GO
ALTER TABLE [dbo].[venta_detalle] CHECK CONSTRAINT [FK_venta_detalle_venta]
GO
/* Object: ForeignKey [FK_venta_detalle_tmp_productos]
Script Date:
09/08/2011 17:27:43 */
ALTER TABLE [dbo].[venta_detalle_tmp] WITH CHECK ADD CONSTRAINT
[FK_venta_detalle_tmp_productos] FOREIGN KEY([id_producto])
REFERENCES [dbo].[productos] ([id_producto])
GO
ALTER TABLE [dbo].[venta_detalle_tmp] CHECK CONSTRAINT
[FK_venta_detalle_tmp_productos]
GO
/* Object: ForeignKey [FK_venta_detalle_tmp_users]
Script Date:
09/08/2011 17:27:43 */
ALTER TABLE [dbo].[venta_detalle_tmp] WITH CHECK ADD CONSTRAINT
[FK_venta_detalle_tmp_users] FOREIGN KEY([user_login])
REFERENCES [dbo].[users] ([user_login])
GO
ALTER TABLE [dbo].[venta_detalle_tmp] CHECK CONSTRAINT
[FK_venta_detalle_tmp_users]
GO
Ad

Recommended

Codigo Server Festival
Codigo Server Festival
UNIVERSIDAD VERACRUZANA
jQuery
jQuery
Andrew Homeyer
PHP webboard
PHP webboard
tumetr1
Divide and Be Conquered?
Divide and Be Conquered?
brooksaix
PHP cart
PHP cart
tumetr1
Sql
Sql
Joao
Yappo Groonga - with japanese search software history @ osdc.tw 2011
Yappo Groonga - with japanese search software history @ osdc.tw 2011
Kazuhiro Osawa
Unidad 4 actividad 1
Unidad 4 actividad 1
KARY
PhoneGap: Local Storage
PhoneGap: Local Storage
Ivano Malavolta
10. view one record
10. view one record
Razvan Raducanu, PhD
11. delete record
11. delete record
Razvan Raducanu, PhD
Keyboard Access APIs
Keyboard Access APIs
toddkloots
Crash Course to SQL in PHP
Crash Course to SQL in PHP
webhostingguy
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to ask
Andrea Giuliano
Leveraging Symfony2 Forms
Leveraging Symfony2 Forms
Bernhard Schussek
Building Your First Widget
Building Your First Widget
Chris Wilcoxson
Open Selector
Open Selector
jjdelc
Creaci坦N Tablas En Oracle
Creaci坦N Tablas En Oracle
esacre
12. edit record
12. edit record
Razvan Raducanu, PhD
My sql
My sql
luiyicastro
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Forrest Chang
Ensayo
Ensayo
Aandres Ssaavedra
Jquery
Jquery
Elite outreach co
Taller 3 camilo uribe2308542
Taller 3 camilo uribe2308542
Kmilo U
JQuery In Rails
JQuery In Rails
Louie Zhao
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
FITSFSd
Taller4
Taller4
Johan Ospina
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
andrewnacin
Access Governance
FSP GmbH

More Related Content

What's hot (20)

PhoneGap: Local Storage
PhoneGap: Local Storage
Ivano Malavolta
10. view one record
10. view one record
Razvan Raducanu, PhD
11. delete record
11. delete record
Razvan Raducanu, PhD
Keyboard Access APIs
Keyboard Access APIs
toddkloots
Crash Course to SQL in PHP
Crash Course to SQL in PHP
webhostingguy
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to ask
Andrea Giuliano
Leveraging Symfony2 Forms
Leveraging Symfony2 Forms
Bernhard Schussek
Building Your First Widget
Building Your First Widget
Chris Wilcoxson
Open Selector
Open Selector
jjdelc
Creaci坦N Tablas En Oracle
Creaci坦N Tablas En Oracle
esacre
12. edit record
12. edit record
Razvan Raducanu, PhD
My sql
My sql
luiyicastro
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Forrest Chang
Ensayo
Ensayo
Aandres Ssaavedra
Jquery
Jquery
Elite outreach co
Taller 3 camilo uribe2308542
Taller 3 camilo uribe2308542
Kmilo U
JQuery In Rails
JQuery In Rails
Louie Zhao
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
FITSFSd
Taller4
Taller4
Johan Ospina
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
andrewnacin
PhoneGap: Local Storage
PhoneGap: Local Storage
Ivano Malavolta
Keyboard Access APIs
Keyboard Access APIs
toddkloots
Crash Course to SQL in PHP
Crash Course to SQL in PHP
webhostingguy
Everything you always wanted to know about forms* *but were afraid to ask
Everything you always wanted to know about forms* *but were afraid to ask
Andrea Giuliano
Leveraging Symfony2 Forms
Leveraging Symfony2 Forms
Bernhard Schussek
Building Your First Widget
Building Your First Widget
Chris Wilcoxson
Open Selector
Open Selector
jjdelc
Creaci坦N Tablas En Oracle
Creaci坦N Tablas En Oracle
esacre
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Ruby-ying Javascript: Avoiding jQuery Spaghetti
Forrest Chang
Taller 3 camilo uribe2308542
Taller 3 camilo uribe2308542
Kmilo U
JQuery In Rails
JQuery In Rails
Louie Zhao
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j dynamic color customization 2udfoh community paper-colo...
FITSFSd
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
andrewnacin

Viewers also liked (16)

Access Governance
FSP GmbH
Nutrizino funtzinoa
Nutrizino funtzinoa
lazycrass6a18
GSR Earth Day Presentation
GSR Earth Day Presentation
Green Self Reliance, Inc.
Final Project (Security Analysis Class)
Final Project (Security Analysis Class)
Ekaterina Kosheleva
Les chateaux de la france
Les chateaux de la france
srahasel
Tramites en comercio exterior y normas origen tlc usa
Santiago Lopez
GSR Newsletter Issue No. 6 - September 2013
GSR Newsletter Issue No. 6 - September 2013
Green Self Reliance, Inc.
Virtualize with Confidence
Virtualize with Confidence
NetWize
Cisco UCS (Unified Computing System)
Cisco UCS (Unified Computing System)
NetWize
Business-Critical Backup: Preparing for a Disaster
Business-Critical Backup: Preparing for a Disaster
NetWize
Sintesis informativa 19 nov 2015
megaradioexpress
Higiene y Seguridad Laboral
B3lleza Online
Location call sheet 5 tk ah ma jg
Location call sheet 5 tk ah ma jg
palomavidal13
WP4C, caracteristicas
LabFerrer LabFerrer
Ingurune bigarren gaia asier amable
Ingurune bigarren gaia asier amable
txutxumutxukat6b04
Access Governance
FSP GmbH
Nutrizino funtzinoa
Nutrizino funtzinoa
lazycrass6a18
Final Project (Security Analysis Class)
Final Project (Security Analysis Class)
Ekaterina Kosheleva
Les chateaux de la france
Les chateaux de la france
srahasel
Tramites en comercio exterior y normas origen tlc usa
Santiago Lopez
GSR Newsletter Issue No. 6 - September 2013
GSR Newsletter Issue No. 6 - September 2013
Green Self Reliance, Inc.
Virtualize with Confidence
Virtualize with Confidence
NetWize
Cisco UCS (Unified Computing System)
Cisco UCS (Unified Computing System)
NetWize
Business-Critical Backup: Preparing for a Disaster
Business-Critical Backup: Preparing for a Disaster
NetWize
Sintesis informativa 19 nov 2015
megaradioexpress
Higiene y Seguridad Laboral
B3lleza Online
Location call sheet 5 tk ah ma jg
Location call sheet 5 tk ah ma jg
palomavidal13
WP4C, caracteristicas
LabFerrer LabFerrer
Ingurune bigarren gaia asier amable
Ingurune bigarren gaia asier amable
txutxumutxukat6b04
Ad

Similar to Bd venta.sql (20)

Database scripts
Database scripts
Ozan G旦yl端s端n
Implementation Specifications
Implementation Specifications
Unmon Mukherjee
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
David Fetter
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
nyin27
Writeable CTEs: The Next Big Thing
Writeable CTEs: The Next Big Thing
PostgreSQL Experts, Inc.
Borrador del blog
Borrador del blog
Sena Cedagro
Uni2
Uni2
miriamfacio
Introducci坦n r叩pida a SQL
Introducci坦n r叩pida a SQL
Carlos Hernando
A Tour to MySQL Commands
A Tour to MySQL Commands
Hikmat Dhamee
Training on Microsoft SQL Server(older version).pptx
Training on Microsoft SQL Server(older version).pptx
naibedyakar00
When solid met angular components
When solid met angular components
Shiri Haim
Chainable datasource
Chainable datasource
CocoaHeads France
Kevin Bengtson Portfolio
Kevin Bengtson Portfolio
Kbengt521
Sql vs no sql diponkar paul-april 2020-Toronto PASS
Sql vs no sql diponkar paul-april 2020-Toronto PASS
Diponkar Paul
David Kopal - Write better React with ReasonML - Codemotion Milan 2018
David Kopal - Write better React with ReasonML - Codemotion Milan 2018
Codemotion
Optimizando MySQL
Optimizando MySQL
Marcelo Altmann
Permissions script for SQL Permissions
Permissions script for SQL Permissions
Tobias Koprowski
Database Implementation Final Document
Database Implementation Final Document
Conor O'Callaghan
Simple Strategies for faster knowledge discovery in big data
Simple Strategies for faster knowledge discovery in big data
Ritesh Agrawal
New Features of SQL Server 2016
New Features of SQL Server 2016
Mir Mahmood
Implementation Specifications
Implementation Specifications
Unmon Mukherjee
Writeable ct es_pgcon_may_2011
Writeable ct es_pgcon_may_2011
David Fetter
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
nyin27
Borrador del blog
Borrador del blog
Sena Cedagro
Introducci坦n r叩pida a SQL
Introducci坦n r叩pida a SQL
Carlos Hernando
A Tour to MySQL Commands
A Tour to MySQL Commands
Hikmat Dhamee
Training on Microsoft SQL Server(older version).pptx
Training on Microsoft SQL Server(older version).pptx
naibedyakar00
When solid met angular components
When solid met angular components
Shiri Haim
Kevin Bengtson Portfolio
Kevin Bengtson Portfolio
Kbengt521
Sql vs no sql diponkar paul-april 2020-Toronto PASS
Sql vs no sql diponkar paul-april 2020-Toronto PASS
Diponkar Paul
David Kopal - Write better React with ReasonML - Codemotion Milan 2018
David Kopal - Write better React with ReasonML - Codemotion Milan 2018
Codemotion
Permissions script for SQL Permissions
Permissions script for SQL Permissions
Tobias Koprowski
Database Implementation Final Document
Database Implementation Final Document
Conor O'Callaghan
Simple Strategies for faster knowledge discovery in big data
Simple Strategies for faster knowledge discovery in big data
Ritesh Agrawal
New Features of SQL Server 2016
New Features of SQL Server 2016
Mir Mahmood
Ad

Bd venta.sql

  • 1. USE [pventa] GO /* Object: Table [dbo].[users] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[users]( [user_login] [nvarchar](50) NOT NULL, [user_password] [nvarchar](250) NULL, [nombre] [nvarchar](150) NULL, [activo] [bit] NOT NULL, [ventas] [bit] NOT NULL, [reportes] [bit] NOT NULL, [administrar] [bit] NOT NULL, [fecha_registro] [datetime] NOT NULL, CONSTRAINT [PK_users] PRIMARY KEY CLUSTERED ( [user_login] 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 /* Object: Table [dbo].[unidad_medida] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[unidad_medida]( [id_unidad_medida] [smallint] NOT NULL, [unidad_medida] [nvarchar](150) NULL, CONSTRAINT [PK_unidad_medida] PRIMARY KEY CLUSTERED ( [id_unidad_medida] 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 /* Object: Table [dbo].[productos] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[productos]( [id_producto] [nvarchar](50) NOT NULL, [producto] [nvarchar](250) NULL, [id_unidad_medida] [smallint] NULL, [p_compra] [float] NULL, [p_venta] [float] NULL, [existencia] [float] NULL, CONSTRAINT [PK_productos] PRIMARY KEY CLUSTERED ( [id_producto] 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 /* Object: Table [dbo].[venta] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
  • 2. CREATE TABLE [dbo].[venta]( [id_venta] [int] IDENTITY(1,1) NOT NULL, [fecha_registro] [datetime] NOT NULL, [user_login] [nvarchar](50) NOT NULL, CONSTRAINT [PK_venta] PRIMARY KEY CLUSTERED ( [id_venta] 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 /* Object: Table [dbo].[venta_detalle_tmp] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[venta_detalle_tmp]( [id_venta_detalle_tmp] [int] IDENTITY(1,1) NOT NULL, [id_producto] [nvarchar](50) NOT NULL, [cantidad] [float] NOT NULL, [user_login] [nvarchar](50) NOT NULL, [p_venta] [float] NOT NULL, CONSTRAINT [PK_venta_detalle_tmp] PRIMARY KEY CLUSTERED ( [id_venta_detalle_tmp] 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 /* Object: Table [dbo].[venta_detalle] Script Date: 09/08/2011 17:27:43 */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[venta_detalle]( [id_venta_detalle] [int] IDENTITY(1,1) NOT NULL, [id_venta] [int] NOT NULL, [id_producto] [nvarchar](50) NOT NULL, [cantidad] [float] NOT NULL, [p_venta] [float] NOT NULL, CONSTRAINT [PK_venta_detalle] PRIMARY KEY CLUSTERED ( [id_venta_detalle] 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 /* Object: Default [DF_users_fecha_registro] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[users] ADD CONSTRAINT [DF_users_fecha_registro] DEFAULT (getdate()) FOR [fecha_registro] GO /* Object: Default [DF_venta_fecha_registro] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta] ADD CONSTRAINT [DF_venta_fecha_registro] DEFAULT (getdate()) FOR [fecha_registro] GO /* Object: ForeignKey [FK_productos_unidad_medida] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[productos] WITH CHECK ADD CONSTRAINT [FK_productos_unidad_medida] FOREIGN KEY([id_unidad_medida]) REFERENCES [dbo].[unidad_medida] ([id_unidad_medida])
  • 3. GO ALTER TABLE [dbo].[productos] CHECK CONSTRAINT [FK_productos_unidad_medida] GO /* Object: ForeignKey [FK_venta_users] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta] WITH CHECK ADD CONSTRAINT [FK_venta_users] FOREIGN KEY([user_login]) REFERENCES [dbo].[users] ([user_login]) GO ALTER TABLE [dbo].[venta] CHECK CONSTRAINT [FK_venta_users] GO /* Object: ForeignKey [FK_venta_detalle_productos] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta_detalle] WITH CHECK ADD CONSTRAINT [FK_venta_detalle_productos] FOREIGN KEY([id_producto]) REFERENCES [dbo].[productos] ([id_producto]) GO ALTER TABLE [dbo].[venta_detalle] CHECK CONSTRAINT [FK_venta_detalle_productos] GO /* Object: ForeignKey [FK_venta_detalle_venta] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta_detalle] WITH CHECK ADD CONSTRAINT [FK_venta_detalle_venta] FOREIGN KEY([id_venta]) REFERENCES [dbo].[venta] ([id_venta]) GO ALTER TABLE [dbo].[venta_detalle] CHECK CONSTRAINT [FK_venta_detalle_venta] GO /* Object: ForeignKey [FK_venta_detalle_tmp_productos] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta_detalle_tmp] WITH CHECK ADD CONSTRAINT [FK_venta_detalle_tmp_productos] FOREIGN KEY([id_producto]) REFERENCES [dbo].[productos] ([id_producto]) GO ALTER TABLE [dbo].[venta_detalle_tmp] CHECK CONSTRAINT [FK_venta_detalle_tmp_productos] GO /* Object: ForeignKey [FK_venta_detalle_tmp_users] Script Date: 09/08/2011 17:27:43 */ ALTER TABLE [dbo].[venta_detalle_tmp] WITH CHECK ADD CONSTRAINT [FK_venta_detalle_tmp_users] FOREIGN KEY([user_login]) REFERENCES [dbo].[users] ([user_login]) GO ALTER TABLE [dbo].[venta_detalle_tmp] CHECK CONSTRAINT [FK_venta_detalle_tmp_users] GO