PersonScope.sql 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*
  2. Navicat SQL Server Data Transfer
  3. Source Server : 9000
  4. Source Server Version : 105000
  5. Source Host : .\sqlexpress:1433
  6. Source Database : LHBMS
  7. Source Schema : dbo
  8. Target Server Type : SQL Server
  9. Target Server Version : 105000
  10. File Encoding : 65001
  11. Date: 2021-05-11 15:33:59
  12. */
  13. -- ----------------------------
  14. -- Table structure for PersonScope
  15. -- ----------------------------
  16. DROP TABLE [dbo].[PersonScope]
  17. GO
  18. CREATE TABLE [dbo].[PersonScope] (
  19. [ID] int NOT NULL IDENTITY(1,1) ,
  20. [DeviceID] uniqueidentifier NOT NULL DEFAULT (newid()) ROWGUIDCOL ,
  21. [AreaType] int NULL ,
  22. [AreaNo] int NULL DEFAULT ((0)) ,
  23. [ZoneNo] int NULL DEFAULT ((0)) ,
  24. [PersonID] uniqueidentifier NULL ,
  25. [AreaName] nvarchar(50) NULL ,
  26. [Remark] nvarchar(50) NULL
  27. )
  28. GO
  29. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  30. 'SCHEMA', N'dbo',
  31. 'TABLE', N'PersonScope',
  32. 'COLUMN', N'AreaType')) > 0)
  33. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'0:基本分区 1:键盘分区'
  34. , @level0type = 'SCHEMA', @level0name = N'dbo'
  35. , @level1type = 'TABLE', @level1name = N'PersonScope'
  36. , @level2type = 'COLUMN', @level2name = N'AreaType'
  37. ELSE
  38. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'0:基本分区 1:键盘分区'
  39. , @level0type = 'SCHEMA', @level0name = N'dbo'
  40. , @level1type = 'TABLE', @level1name = N'PersonScope'
  41. , @level2type = 'COLUMN', @level2name = N'AreaType'
  42. GO
  43. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  44. 'SCHEMA', N'dbo',
  45. 'TABLE', N'PersonScope',
  46. 'COLUMN', N'AreaNo')) > 0)
  47. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'防区名称'
  48. , @level0type = 'SCHEMA', @level0name = N'dbo'
  49. , @level1type = 'TABLE', @level1name = N'PersonScope'
  50. , @level2type = 'COLUMN', @level2name = N'AreaNo'
  51. ELSE
  52. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'防区名称'
  53. , @level0type = 'SCHEMA', @level0name = N'dbo'
  54. , @level1type = 'TABLE', @level1name = N'PersonScope'
  55. , @level2type = 'COLUMN', @level2name = N'AreaNo'
  56. GO
  57. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  58. 'SCHEMA', N'dbo',
  59. 'TABLE', N'PersonScope',
  60. 'COLUMN', N'ZoneNo')) > 0)
  61. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'所属分区'
  62. , @level0type = 'SCHEMA', @level0name = N'dbo'
  63. , @level1type = 'TABLE', @level1name = N'PersonScope'
  64. , @level2type = 'COLUMN', @level2name = N'ZoneNo'
  65. ELSE
  66. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'所属分区'
  67. , @level0type = 'SCHEMA', @level0name = N'dbo'
  68. , @level1type = 'TABLE', @level1name = N'PersonScope'
  69. , @level2type = 'COLUMN', @level2name = N'ZoneNo'
  70. GO
  71. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  72. 'SCHEMA', N'dbo',
  73. 'TABLE', N'PersonScope',
  74. 'COLUMN', N'PersonID')) > 0)
  75. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'所属使用者'
  76. , @level0type = 'SCHEMA', @level0name = N'dbo'
  77. , @level1type = 'TABLE', @level1name = N'PersonScope'
  78. , @level2type = 'COLUMN', @level2name = N'PersonID'
  79. ELSE
  80. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'所属使用者'
  81. , @level0type = 'SCHEMA', @level0name = N'dbo'
  82. , @level1type = 'TABLE', @level1name = N'PersonScope'
  83. , @level2type = 'COLUMN', @level2name = N'PersonID'
  84. GO
  85. -- ----------------------------
  86. -- Records of PersonScope
  87. -- ----------------------------
  88. SET IDENTITY_INSERT [dbo].[PersonScope] ON
  89. GO
  90. SET IDENTITY_INSERT [dbo].[PersonScope] OFF
  91. GO
  92. -- ----------------------------
  93. -- Indexes structure for table PersonScope
  94. -- ----------------------------
  95. -- ----------------------------
  96. -- Primary Key structure for table PersonScope
  97. -- ----------------------------
  98. ALTER TABLE [dbo].[PersonScope] ADD PRIMARY KEY ([ID])
  99. GO