Advertisement
cyecize

Untitled

Sep 9th, 2021
1,598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 2.02 KB | None | 0 0
  1. /****** Object:  Table [dbo].[tbl_Entities]    Script Date: 7/30/2021 10:28:44 AM ******/
  2. IF  EXISTS (SELECT *
  3. FROM sys.indexes
  4. WHERE name='tbl_InventoryReference_entity_partnum_warehouse_index' AND object_id = OBJECT_ID('[dbo].[tbl_InventoryReference]'))
  5.     DROP INDEX [tbl_InventoryReference_entity_partnum_warehouse_index] ON [dbo].[tbl_InventoryReference]
  6. GO
  7.  
  8. IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbl_InventoryReference]') AND type in (N'U'))
  9.     DROP TABLE [dbo].[tbl_InventoryReference]
  10. GO
  11.  
  12. /****** Object:  Table [dbo].[tbl_Entities]    Script Date: 7/30/2021 10:28:44 AM ******/
  13. SET ANSI_NULLS ON
  14. GO
  15.  
  16. SET QUOTED_IDENTIFIER ON
  17. GO
  18.  
  19. CREATE TABLE [dbo].[tbl_InventoryReference](
  20.     [id] [int] IDENTITY(1,1) NOT NULL,
  21.     [col_partnum]  [nvarchar] (50) NULL,
  22.     [col_class]  [nvarchar] (3) NULL,
  23.     [col_mfr]  [nvarchar](3) NULL,
  24.     [col_parentMfr]  [nvarchar] (3) NULL,
  25.     [col_warehouse]  [nvarchar] (3) NULL,
  26.     [col_parentwarehouse]  [nvarchar] (3) NULL,
  27.     [col_Entity]  [nvarchar](3) NULL,
  28.     [col_pnet_ats]   [int] NULL,
  29.     [col_inet_ats]   [int] NULL,
  30.     [col_Eccn]  [nvarchar] (100) NULL,
  31.     [col_Hts]  [nvarchar] (100) NULL,
  32.     [col_CountryOfOrigin]  [nvarchar] (400) NULL,
  33.     [col_AllocProductInd]  [nvarchar] (2) NULL
  34.  
  35.  CONSTRAINT [PK_InventoryID] PRIMARY KEY CLUSTERED
  36. (
  37.     [id] ASC
  38. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
  39. ) ON [PRIMARY]
  40. GO
  41.  
  42. CREATE NONCLUSTERED INDEX [tbl_InventoryReference_entity_partnum_warehouse_index] ON [dbo].[tbl_InventoryReference]
  43. (
  44.     [col_Entity] ASC,
  45.     [col_partnum] ASC,
  46.     [col_warehouse] ASC
  47. )
  48. INCLUDE([id],
  49.     [col_class],
  50.     [col_mfr],
  51.     [col_parentMfr],
  52.     [col_parentwarehouse],
  53.     [col_pnet_ats],
  54.     [col_inet_ats],
  55.     [col_Eccn],
  56.     [col_Hts],
  57.     [col_CountryOfOrigin],
  58.     [col_AllocProductInd]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF)
  59. GO
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement