ZoneInfo.sql 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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:34:36
  12. */
  13. -- ----------------------------
  14. -- Table structure for ZoneInfo
  15. -- ----------------------------
  16. DROP TABLE [dbo].[ZoneInfo]
  17. GO
  18. CREATE TABLE [dbo].[ZoneInfo] (
  19. [ID] uniqueidentifier NOT NULL DEFAULT (newid()) ROWGUIDCOL ,
  20. [ZoneNo] int NOT NULL DEFAULT ((0)) ,
  21. [Name] nvarchar(50) NOT NULL ,
  22. [ZoneType] int NULL ,
  23. [ActiveType] int NULL DEFAULT ((0)) ,
  24. [AreaID] int NULL ,
  25. [DevID] uniqueidentifier NULL
  26. )
  27. GO
  28. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  29. 'SCHEMA', N'dbo',
  30. 'TABLE', N'ZoneInfo',
  31. 'COLUMN', N'ZoneType')) > 0)
  32. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'0:基本分区防区;1:键盘防区'
  33. , @level0type = 'SCHEMA', @level0name = N'dbo'
  34. , @level1type = 'TABLE', @level1name = N'ZoneInfo'
  35. , @level2type = 'COLUMN', @level2name = N'ZoneType'
  36. ELSE
  37. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'0:基本分区防区;1:键盘防区'
  38. , @level0type = 'SCHEMA', @level0name = N'dbo'
  39. , @level1type = 'TABLE', @level1name = N'ZoneInfo'
  40. , @level2type = 'COLUMN', @level2name = N'ZoneType'
  41. GO
  42. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  43. 'SCHEMA', N'dbo',
  44. 'TABLE', N'ZoneInfo',
  45. 'COLUMN', N'DevID')) > 0)
  46. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'所属主机'
  47. , @level0type = 'SCHEMA', @level0name = N'dbo'
  48. , @level1type = 'TABLE', @level1name = N'ZoneInfo'
  49. , @level2type = 'COLUMN', @level2name = N'DevID'
  50. ELSE
  51. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'所属主机'
  52. , @level0type = 'SCHEMA', @level0name = N'dbo'
  53. , @level1type = 'TABLE', @level1name = N'ZoneInfo'
  54. , @level2type = 'COLUMN', @level2name = N'DevID'
  55. GO
  56. -- ----------------------------
  57. -- Records of ZoneInfo
  58. -- ----------------------------
  59. -- ----------------------------
  60. -- Indexes structure for table ZoneInfo
  61. -- ----------------------------
  62. -- ----------------------------
  63. -- Primary Key structure for table ZoneInfo
  64. -- ----------------------------
  65. ALTER TABLE [dbo].[ZoneInfo] ADD PRIMARY KEY ([ID])
  66. GO
  67. -- ----------------------------
  68. -- Uniques structure for table ZoneInfo
  69. -- ----------------------------
  70. ALTER TABLE [dbo].[ZoneInfo] ADD UNIQUE ([ZoneNo] ASC, [ZoneType] ASC, [AreaID] ASC, [DevID] ASC)
  71. GO