Jovenes descargar Backup de BD y codigo, hacer que funcione la web
Descargar Backup
Descargar Codigo
Driver SQLJDBC para sql server 2005 a +
Diapos JDBC
Script
USE [BD_VENTAS]
GO
/****** Object: Table [dbo].[TUsuario] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TUsuario](
[Codigo] [varchar](10) NULL,
[Clave] [int] NULL,
[Nombres] [varchar](50) NULL,
[Perfil] [char](1) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[TProducto] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TProducto](
[Codigo] [int] NULL,
[Descripcion] [varchar](50) NULL,
[Stock] [int] NULL,
[Precio] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[TDetPedido] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TDetPedido](
[IdCabPedido] [int] NULL,
[CodigoProducto] [int] NULL,
[Cantidad] [int] NULL,
[Precio] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[TCabPedido] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TCabPedido](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CodigoUsuario] [varchar](10) NULL,
[CodigoCliente] [varchar](10) NULL,
[Fecha] [datetime] NULL,
[FormaPago] [varchar](10) NULL,
[MontoTotal] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: StoredProcedure [dbo].[SPU_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPU_PRODUCTO]
@CODIGO INT
,@DESCRIPCION VARCHAR(50)
,@STOCK INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
UPDATE TProducto
SET Codigo = @CODIGO
,Descripcion = @DESCRIPCION
,Stock = @STOCK
,Precio = @PRECIO
END
GO
/****** Object: StoredProcedure [dbo].[SPS_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPS_PRODUCTO]
AS
BEGIN
SELECT Codigo, Descripcion, Stock, Precio
FROM TProducto
END
GO
/****** Object: StoredProcedure [dbo].[SPI_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_PRODUCTO]
@CODIGO INT
,@DESCRIPCION VARCHAR(50)
,@STOCK INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
INSERT INTO TProducto
VALUES (@CODIGO, @DESCRIPCION, @STOCK, @PRECIO)
END
GO
/****** Object: StoredProcedure [dbo].[SPI_DETPEDIDO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_DETPEDIDO]
@IDPEDIDO INT
,@CODPRODUCTO INT
,@CANTIDAD INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
INSERT INTO TDetPedido
VALUES (@IDPEDIDO, @CODPRODUCTO, @CANTIDAD, @PRECIO)
END
GO
/****** Object: StoredProcedure [dbo].[SPI_CABPEDIDO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_CABPEDIDO]
@CODUSUARIO VARCHAR(10)
,@CODCLIENTE VARCHAR(10)
,@FECHA DATETIME
,@FORMAPAGO VARCHAR(10)
,@MONTOTOTAL DECIMAL(18,2)
,@IDPEDIDO INT OUTPUT
AS
BEGIN
INSERT INTO TCabPedido
VALUES (@CODUSUARIO, @CODCLIENTE, @FECHA, @FORMAPAGO, @MONTOTOTAL)
SET @IDPEDIDO = @@IDENTITY --SCOPE_IDENTITY --@@IDENTITY;
END
GO
/****** Object: StoredProcedure [dbo].[SPF_USUARIO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPF_USUARIO]
@CODIGO VARCHAR(10)
,@CLAVE INT
AS
BEGIN
--SET NOCOUNT ON;
SELECT Codigo, Clave, Nombres, Perfil
FROM TUsuario
WHERE Codigo like @CODIGO AND Clave = @CLAVE
END
GO
/****** Object: StoredProcedure [dbo].[SPF_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPF_PRODUCTO]
@CODIGO INT
AS
BEGIN
SELECT Codigo, Descripcion, Stock, Precio
FROM TProducto
WHERE Codigo = @CODIGO
END
GO
Descargar Backup
Descargar Codigo
Driver SQLJDBC para sql server 2005 a +
Diapos JDBC
Script
USE [BD_VENTAS]
GO
/****** Object: Table [dbo].[TUsuario] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TUsuario](
[Codigo] [varchar](10) NULL,
[Clave] [int] NULL,
[Nombres] [varchar](50) NULL,
[Perfil] [char](1) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[TProducto] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TProducto](
[Codigo] [int] NULL,
[Descripcion] [varchar](50) NULL,
[Stock] [int] NULL,
[Precio] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[TDetPedido] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TDetPedido](
[IdCabPedido] [int] NULL,
[CodigoProducto] [int] NULL,
[Cantidad] [int] NULL,
[Precio] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[TCabPedido] Script Date: 11/12/2012 21:41:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TCabPedido](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CodigoUsuario] [varchar](10) NULL,
[CodigoCliente] [varchar](10) NULL,
[Fecha] [datetime] NULL,
[FormaPago] [varchar](10) NULL,
[MontoTotal] [decimal](18, 2) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: StoredProcedure [dbo].[SPU_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPU_PRODUCTO]
@CODIGO INT
,@DESCRIPCION VARCHAR(50)
,@STOCK INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
UPDATE TProducto
SET Codigo = @CODIGO
,Descripcion = @DESCRIPCION
,Stock = @STOCK
,Precio = @PRECIO
END
GO
/****** Object: StoredProcedure [dbo].[SPS_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPS_PRODUCTO]
AS
BEGIN
SELECT Codigo, Descripcion, Stock, Precio
FROM TProducto
END
GO
/****** Object: StoredProcedure [dbo].[SPI_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_PRODUCTO]
@CODIGO INT
,@DESCRIPCION VARCHAR(50)
,@STOCK INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
INSERT INTO TProducto
VALUES (@CODIGO, @DESCRIPCION, @STOCK, @PRECIO)
END
GO
/****** Object: StoredProcedure [dbo].[SPI_DETPEDIDO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_DETPEDIDO]
@IDPEDIDO INT
,@CODPRODUCTO INT
,@CANTIDAD INT
,@PRECIO DECIMAL(18,2)
AS
BEGIN
INSERT INTO TDetPedido
VALUES (@IDPEDIDO, @CODPRODUCTO, @CANTIDAD, @PRECIO)
END
GO
/****** Object: StoredProcedure [dbo].[SPI_CABPEDIDO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPI_CABPEDIDO]
@CODUSUARIO VARCHAR(10)
,@CODCLIENTE VARCHAR(10)
,@FECHA DATETIME
,@FORMAPAGO VARCHAR(10)
,@MONTOTOTAL DECIMAL(18,2)
,@IDPEDIDO INT OUTPUT
AS
BEGIN
INSERT INTO TCabPedido
VALUES (@CODUSUARIO, @CODCLIENTE, @FECHA, @FORMAPAGO, @MONTOTOTAL)
SET @IDPEDIDO = @@IDENTITY --SCOPE_IDENTITY --@@IDENTITY;
END
GO
/****** Object: StoredProcedure [dbo].[SPF_USUARIO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPF_USUARIO]
@CODIGO VARCHAR(10)
,@CLAVE INT
AS
BEGIN
--SET NOCOUNT ON;
SELECT Codigo, Clave, Nombres, Perfil
FROM TUsuario
WHERE Codigo like @CODIGO AND Clave = @CLAVE
END
GO
/****** Object: StoredProcedure [dbo].[SPF_PRODUCTO] Script Date: 11/12/2012 21:41:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPF_PRODUCTO]
@CODIGO INT
AS
BEGIN
SELECT Codigo, Descripcion, Stock, Precio
FROM TProducto
WHERE Codigo = @CODIGO
END
GO
Comentarios
Publicar un comentario