CREATE TABLE devolucion_proveedor( [folio] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [ordencompra] int NOT NULL references ordenescompra(ordencompra), [fecha] [datetime] NOT NULL DEFAULT(GETDATE()), [comentarios] [varchar](512) NOT NULL, [ID_SKU] int NOT NULL references SKU(ID_SKU), [cantidad] float NOT NULL, [notacredito] int NULL references notasdecredito(id), [fecha_captura_nc] [datetime] NULL, [tipo] [nvarchar](16) NOT NULL ) DEFECTUOSO NO UTILIZADO NOPRT INCORRECTO CREATE TABLE salidas_tsv( [folio] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [fecha] [datetime] NOT NULL DEFAULT(GETDATE()), [retiro] [varchar](64) NOT NULL, [usuario] int NOT NULL --,[detalle] [varchar](512) NULL ) CREATE TABLE salidas_tsv_detalles( [id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, [folio] int NOT NULL REFERENCES salidas_tsv(folio), [tipo] [varchar](16) NOT NULL,--Muestra,Casco/Core,Scrap/herramienta/Desecho,Transferencia de Inventario [referencia] int NULL, [no_parte] [varchar](16) NULL, [descripcion] [varchar](128) NOT NULL, [cantidad] int NOT NULL, [destino] [varchar](24) NOT NULL, [fecha_recibio] [datetime] NULL, [recibio] [varchar](64) NULL )