2020-11-30 15.30.sql 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. USE [befri_Goldhoo]
  2. GO
  3. /****** Object: Table [Discount].[DiscountRecLine] Script Date: 2020/12/4 11:42:01 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. SET ANSI_PADDING ON
  9. GO
  10. CREATE TABLE [Discount].[DiscountRecLine](
  11. [DiscountRecLineId] [int] NOT NULL,
  12. [DiscountRecId] [int] NOT NULL,
  13. [InventoryId] [int] NOT NULL,
  14. [InventoryNumber] [varchar](20) NULL,
  15. [InventoryName] [nvarchar](50) NULL,
  16. [Spec] [varchar](200) NULL,
  17. [BatchNumber] [varchar](20) NULL,
  18. [IncreasedQty] [numeric](9, 0) NOT NULL,
  19. [DecreasedQty] [numeric](9, 0) NOT NULL,
  20. [DiscountCoef] [numeric](5, 2) NULL,
  21. [IncreasedPrice] [money] NULL,
  22. [DecreasedPrice] [money] NULL,
  23. [IncreasedMoney] [money] NULL,
  24. [DecreasedMoney] [money] NULL,
  25. [LineStatus] [tinyint] NULL,
  26. [VersionNumber] [smallint] NOT NULL,
  27. [Description] [nvarchar](200) NULL,
  28. CONSTRAINT [PK_DISCOUNTRECLINE] PRIMARY KEY CLUSTERED
  29. (
  30. [DiscountRecLineId] ASC
  31. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  32. ) ON [PRIMARY]
  33. GO
  34. SET ANSI_PADDING ON
  35. GO
  36. ALTER TABLE [Discount].[DiscountRecLine] ADD CONSTRAINT [DF__DiscountR__Versi__488B491C] DEFAULT ((0)) FOR [VersionNumber]
  37. GO
  38. ALTER TABLE [Discount].[DiscountRecLine] WITH CHECK ADD CONSTRAINT [FK_DISCOUNT_REFERENCE_DISCOUNT] FOREIGN KEY([DiscountRecId])
  39. REFERENCES [Discount].[DiscountRec] ([DiscountRecId])
  40. ON UPDATE CASCADE
  41. ON DELETE CASCADE
  42. GO
  43. ALTER TABLE [Discount].[DiscountRecLine] CHECK CONSTRAINT [FK_DISCOUNT_REFERENCE_DISCOUNT]
  44. GO
  45. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'存货入出库记录行内码' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DiscountRecLineId'
  46. GO
  47. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'存货入出库记录内码' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DiscountRecId'
  48. GO
  49. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'存货内码' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'InventoryId'
  50. GO
  51. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'存货编码' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'InventoryNumber'
  52. GO
  53. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'存货名称' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'InventoryName'
  54. GO
  55. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'规格型号' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'Spec'
  56. GO
  57. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'批号' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'BatchNumber'
  58. GO
  59. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'入库数量' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'IncreasedQty'
  60. GO
  61. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出库数量' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DecreasedQty'
  62. GO
  63. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣系数' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DiscountCoef'
  64. GO
  65. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'入库单价' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'IncreasedPrice'
  66. GO
  67. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出库单价' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DecreasedPrice'
  68. GO
  69. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'增加金额' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'IncreasedMoney'
  70. GO
  71. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'减少金额' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'DecreasedMoney'
  72. GO
  73. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'行状态' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'LineStatus'
  74. GO
  75. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录版本' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'VersionNumber'
  76. GO
  77. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine', @level2type=N'COLUMN',@level2name=N'Description'
  78. GO
  79. EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣管理.折扣产品入出库记录行' , @level0type=N'SCHEMA',@level0name=N'Discount', @level1type=N'TABLE',@level1name=N'DiscountRecLine'
  80. GO