Description
Properties
| Name | Value |
|---|---|
| File Collation | |
| File Group | |
| Filestream File Group | |
| Is Partitioned | False |
| Partitioned Column | |
| Partition Scheme | |
| File Groups | |
| Filestream Partition Scheme | |
| Filestream File Groups | |
| Heap | False |
| Full Text Catalog | |
| Full Text | |
| Compression | NONE |
| Row Count (~) | 0 |
| Created | 3/6/2025 6:55:52 PM |
| Last Modified | 3/6/2025 6:55:57 PM |
Columns
11| Key | Name | Data Type | Length | Precision | Scale | Not Null | Identity | Rule | Default | Computed | Persisted | Description |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| consumo | int | 4 | 10 | 0 | True |
1 - 1 | False |
False |
||||
| item_contrato | int | 4 | 10 | 0 | False |
False |
False |
|||||
| cliente | int | 4 | 10 | 0 | False |
False |
False |
|||||
| producto | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| tipo_cambio | decimal | 5 | 9 | 5 | False |
False |
False |
|||||
| informe | int | 4 | 10 | 0 | False |
False |
False |
|||||
| cantidad_consumida | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| user_id | int | 4 | 10 | 0 | False |
False |
False |
|||||
| consumido | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| delivery | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| notas_consumo | text | 0 | 0 | False |
False |
False |
Foreign Keys
4| Name | Columns | Description |
|---|---|---|
| FK__consumo_c__infor__2EF0D041 | informe | |
| FK__consumo_c__item___2FE4F47A | item_contrato | |
| FK__consumo_c__produ__30D918B3 | producto | |
| FK__consumo_c__user___31CD3CEC | user_id |
SQL Script
Copy
CREATE TABLE dbo.consumo_contratos (
consumo int IDENTITY,
item_contrato int NULL,
cliente int NULL,
producto smallint NULL,
tipo_cambio decimal(9, 5) NULL,
informe int NULL,
cantidad_consumida smallint NULL,
user_id int NULL,
consumido datetime NULL,
delivery datetime NULL,
notas_consumo text NULL,
PRIMARY KEY CLUSTERED (consumo) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE dbo.consumo_contratos WITH NOCHECK
ADD FOREIGN KEY (informe) REFERENCES dbo.informes (informe)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (item_contrato) REFERENCES dbo.contratos_items (item_contrato)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (producto) REFERENCES dbo.productos (producto)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (user_id) REFERENCES dbo.users (user_id)
GO
consumo int IDENTITY,
item_contrato int NULL,
cliente int NULL,
producto smallint NULL,
tipo_cambio decimal(9, 5) NULL,
informe int NULL,
cantidad_consumida smallint NULL,
user_id int NULL,
consumido datetime NULL,
delivery datetime NULL,
notas_consumo text NULL,
PRIMARY KEY CLUSTERED (consumo) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE dbo.consumo_contratos WITH NOCHECK
ADD FOREIGN KEY (informe) REFERENCES dbo.informes (informe)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (item_contrato) REFERENCES dbo.contratos_items (item_contrato)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (producto) REFERENCES dbo.productos (producto)
GO
ALTER TABLE dbo.consumo_contratos
ADD FOREIGN KEY (user_id) REFERENCES dbo.users (user_id)
GO
Depends On
5Used By
No items found