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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| item_contrato | int | 4 | 10 | 0 | True |
1 - 1 | False |
False |
||||
| id_contrato | int | 4 | 10 | 0 | True |
False |
False |
|||||
| producto | smallint | 2 | 5 | 0 | True |
False |
False |
|||||
| pais_cliente | varchar | 2 | 0 | 0 | False |
False |
False |
|||||
| cliente | int | 4 | 10 | 0 | False |
False |
False |
|||||
| cantidad_producto | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| precio_unitario | money | 8 | 19 | 4 | False |
False |
False |
|||||
| moneda | varchar | 3 | 0 | 0 | False |
False |
False |
|||||
| precio_referencia_usd | money | 8 | 19 | 4 | False |
False |
False |
|||||
| filial | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| observaciones | text | 0 | 0 | False |
False |
False |
Indexes
1Foreign Keys
4| Name | Columns | Description |
|---|---|---|
| FK__contratos__clien__391C8655 | cliente | |
| FK__contratos__filia__37861642 | filial | |
| FK__contratos__id_co__387A3A7B | id_contrato | |
| FK__contratos__produ__396E5EB4 | producto |
SQL Script
Copy
CREATE TABLE dbo.contratos_items (
item_contrato int IDENTITY,
id_contrato int NOT NULL,
producto smallint NOT NULL,
pais_cliente varchar(2) NULL,
cliente int NULL,
cantidad_producto smallint NULL,
precio_unitario money NULL,
moneda varchar(3) NULL,
precio_referencia_usd money NULL,
filial smallint NULL,
observaciones text NULL,
PRIMARY KEY CLUSTERED (item_contrato) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE dbo.contratos_items WITH NOCHECK
ADD CONSTRAINT FK__contratos__clien__391C8655 FOREIGN KEY (cliente) REFERENCES dbo.clientes (cliente)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (filial) REFERENCES dbo.filiales (filial)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (id_contrato) REFERENCES dbo.contratos_grupos (id_contrato)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (producto) REFERENCES dbo.productos (producto)
GO
item_contrato int IDENTITY,
id_contrato int NOT NULL,
producto smallint NOT NULL,
pais_cliente varchar(2) NULL,
cliente int NULL,
cantidad_producto smallint NULL,
precio_unitario money NULL,
moneda varchar(3) NULL,
precio_referencia_usd money NULL,
filial smallint NULL,
observaciones text NULL,
PRIMARY KEY CLUSTERED (item_contrato) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE dbo.contratos_items WITH NOCHECK
ADD CONSTRAINT FK__contratos__clien__391C8655 FOREIGN KEY (cliente) REFERENCES dbo.clientes (cliente)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (filial) REFERENCES dbo.filiales (filial)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (id_contrato) REFERENCES dbo.contratos_grupos (id_contrato)
GO
ALTER TABLE dbo.contratos_items
ADD FOREIGN KEY (producto) REFERENCES dbo.productos (producto)
GO