Tables [dbo].[inv_reconcile_item]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count0
Created12:31:02 PM Sunday, December 05, 2010
Last Modified12:57:27 PM Sunday, December 05, 2010
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Cluster Primary Key XPKinv_reconcile_item: object_uuid\item_name_id\item_parent_idobject_uuidbinary(16)16
No
Cluster Primary Key XPKinv_reconcile_item: object_uuid\item_name_id\item_parent_iditem_parent_idint4
No
Cluster Primary Key XPKinv_reconcile_item: object_uuid\item_name_id\item_parent_iditem_name_idint4
No
item_root_idint4
Yes
item_root_name_idint4
Yes
item_parent_name_idint4
Yes
item_indexint4
Yes
item_typeint4
Yes
item_formatint4
Yes
item_value_textnvarchar(384)768
Yes
item_previous_value_textnvarchar(384)768
Yes
item_value_longint4
Yes
item_previous_value_longint4
Yes
item_value_doublefloat8
Yes
item_previous_value_doublefloat8
Yes
item_dateint4
Yes
item_lockint4
Yes
domain_uuidbinary(16)16
Yes
auto_rep_versiontimestamp8
Yes
Foreign Keys FKinv_reconitem_tnt: [dbo].[ca_tenant].tenant_idtenant_idbinary(16)16
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key XPKinv_reconcile_item: object_uuid\item_name_id\item_parent_idXPKinv_reconcile_itemobject_uuid, item_name_id, item_parent_id
Yes
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
r_V_RECONCILE_ITE
Yes
Yes
After Insert
Foreign Keys Foreign Keys
NameColumns
FKinv_reconitem_tnttenant_id->[dbo].[ca_tenant].[id]
Permissions
TypeActionOwning Principal
GrantInsertswcmadmin
GrantDeleteca_itrm_group
GrantInsertca_itrm_group
GrantDeleteswcmadmin
GrantSelectams_group
GrantSelectaiadmin
GrantSelectamsgroup
GrantSelectca_itrm_group
GrantUpdateca_itrm_group
GrantSelectca_itrm_group_ams
GrantSelectswcmadmin
GrantUpdateswcmadmin
SQL Script
CREATE TABLE [dbo].[inv_reconcile_item]
(
[object_uuid] [binary] (16) NOT NULL,
[item_parent_id] [int] NOT NULL,
[item_name_id] [int] NOT NULL,
[item_root_id] [int] NULL,
[item_root_name_id] [int] NULL,
[item_parent_name_id] [int] NULL,
[item_index] [int] NULL,
[item_type] [int] NULL,
[item_format] [int] NULL,
[item_value_text] [nvarchar] (384) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[item_previous_value_text] [nvarchar] (384) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[item_value_long] [int] NULL,
[item_previous_value_long] [int] NULL,
[item_value_double] [float] NULL,
[item_previous_value_double] [float] NULL,
[item_date] [int] NULL,
[item_lock] [int] NULL,
[domain_uuid] [binary] (16) NULL,
[auto_rep_version] [timestamp] NULL,
[tenant_id] [binary] (16) NULL
) ON [PRIMARY]

GO
create trigger r_V_RECONCILE_ITE on dbo.INV_RECONCILE_ITEM after insert  as  begin     update dbo.INV_RECONCILE_ITEM set tenant_id=a.tenant_id             from ca_agent a , inserted newinv              where a.object_uuid = dbo.INV_RECONCILE_ITEM.object_uuid                and dbo.INV_RECONCILE_ITEM.object_uuid = newinv.object_uuid                and dbo.INV_RECONCILE_ITEM.item_name_id = newinv.item_name_id                and dbo.INV_RECONCILE_ITEM.item_parent_id = newinv.item_parent_id;  end;
GO
ALTER TABLE [dbo].[inv_reconcile_item] ADD CONSTRAINT [XPKinv_reconcile_item] PRIMARY KEY CLUSTERED ([object_uuid], [item_name_id], [item_parent_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[inv_reconcile_item] ADD CONSTRAINT [FKinv_reconitem_tnt] FOREIGN KEY ([tenant_id]) REFERENCES [dbo].[ca_tenant] ([id])
GO
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [aiadmin]
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [ams_group]
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [amsgroup]
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [ca_itrm_group]
GRANT INSERT ON  [dbo].[inv_reconcile_item] TO [ca_itrm_group]
GRANT DELETE ON  [dbo].[inv_reconcile_item] TO [ca_itrm_group]
GRANT UPDATE ON  [dbo].[inv_reconcile_item] TO [ca_itrm_group]
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [ca_itrm_group_ams]
GRANT SELECT ON  [dbo].[inv_reconcile_item] TO [swcmadmin]
GRANT INSERT ON  [dbo].[inv_reconcile_item] TO [swcmadmin]
GRANT DELETE ON  [dbo].[inv_reconcile_item] TO [swcmadmin]
GRANT UPDATE ON  [dbo].[inv_reconcile_item] TO [swcmadmin]
GO
Uses
Used By