Documentos de Académico
Documentos de Profesional
Documentos de Cultura
CREATE Table Ventas
CREATE Table Ventas
(
Idventa int IDENTITY(1,1) PRIMARY KEY,
Fecha datetime NOT NULL DEFAULT GETDATE(),
Cant int NOT NULL,
Idproduct int FOREIGN KEY REFERENCES Productos(Idproducto)
)
CREATE TABLE Productos
(
Idproducto int IDENTITY(1,1) PRIMARY KEY,
ProductName varchar(255) NOT NULL,
ProductDesc varchar(255),
Cantidad int NOT NULL,
Precio decimal NOT NULL,
CONSTRAINT check_cont CHECK (Cantidad>-1)
)
drop TABLE Productos
select * from productos
select * from ventas
INSERT INTO Productos(ProductName,ProductDesc,Cantidad,Precio)
VALUES ('Cuaderno','cuadernos marca balboa',50,2.50);
CREATE PROCEDURE vendiendo
@Idproc int,
@quant int
as
--INSERT INTO productos(ProductName ,ProductDesc , Cantidad, Precio)
--VALUES(@product_name , @product_desc , @cant,@precio);
GO
EXECUTE vendiendo 1, 25
USE [Northwind]
GO
/****** Object: StoredProcedure [dbo].[vendiendo]
Script Date: 04/10/2016 21
:08:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[vendiendo]
@Idproc int,
@quant int
as
--INSERT INTO productos(ProductName ,ProductDesc , Cantidad, Precio)