Organization.sql 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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:42
  12. */
  13. -- ----------------------------
  14. -- Table structure for Organization
  15. -- ----------------------------
  16. DROP TABLE [dbo].[Organization]
  17. GO
  18. CREATE TABLE [dbo].[Organization] (
  19. [ID] uniqueidentifier NOT NULL DEFAULT (newid()) ROWGUIDCOL ,
  20. [Name] nvarchar(50) NOT NULL ,
  21. [Address] nvarchar(100) NULL ,
  22. [Telphone] nvarchar(50) NULL ,
  23. [Owner] nvarchar(50) NULL ,
  24. [ParentID] uniqueidentifier NULL ,
  25. [Remark] nvarchar(100) NULL
  26. )
  27. GO
  28. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  29. 'SCHEMA', N'dbo',
  30. 'TABLE', N'Organization',
  31. 'COLUMN', N'Name')) > 0)
  32. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'名称'
  33. , @level0type = 'SCHEMA', @level0name = N'dbo'
  34. , @level1type = 'TABLE', @level1name = N'Organization'
  35. , @level2type = 'COLUMN', @level2name = N'Name'
  36. ELSE
  37. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'名称'
  38. , @level0type = 'SCHEMA', @level0name = N'dbo'
  39. , @level1type = 'TABLE', @level1name = N'Organization'
  40. , @level2type = 'COLUMN', @level2name = N'Name'
  41. GO
  42. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  43. 'SCHEMA', N'dbo',
  44. 'TABLE', N'Organization',
  45. 'COLUMN', N'Address')) > 0)
  46. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'详细地址'
  47. , @level0type = 'SCHEMA', @level0name = N'dbo'
  48. , @level1type = 'TABLE', @level1name = N'Organization'
  49. , @level2type = 'COLUMN', @level2name = N'Address'
  50. ELSE
  51. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'详细地址'
  52. , @level0type = 'SCHEMA', @level0name = N'dbo'
  53. , @level1type = 'TABLE', @level1name = N'Organization'
  54. , @level2type = 'COLUMN', @level2name = N'Address'
  55. GO
  56. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  57. 'SCHEMA', N'dbo',
  58. 'TABLE', N'Organization',
  59. 'COLUMN', N'Telphone')) > 0)
  60. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'联系电话'
  61. , @level0type = 'SCHEMA', @level0name = N'dbo'
  62. , @level1type = 'TABLE', @level1name = N'Organization'
  63. , @level2type = 'COLUMN', @level2name = N'Telphone'
  64. ELSE
  65. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'联系电话'
  66. , @level0type = 'SCHEMA', @level0name = N'dbo'
  67. , @level1type = 'TABLE', @level1name = N'Organization'
  68. , @level2type = 'COLUMN', @level2name = N'Telphone'
  69. GO
  70. IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description',
  71. 'SCHEMA', N'dbo',
  72. 'TABLE', N'Organization',
  73. 'COLUMN', N'Owner')) > 0)
  74. EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'负责人'
  75. , @level0type = 'SCHEMA', @level0name = N'dbo'
  76. , @level1type = 'TABLE', @level1name = N'Organization'
  77. , @level2type = 'COLUMN', @level2name = N'Owner'
  78. ELSE
  79. EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'负责人'
  80. , @level0type = 'SCHEMA', @level0name = N'dbo'
  81. , @level1type = 'TABLE', @level1name = N'Organization'
  82. , @level2type = 'COLUMN', @level2name = N'Owner'
  83. GO
  84. -- ----------------------------
  85. -- Records of Organization
  86. -- ----------------------------
  87. -- ----------------------------
  88. -- Indexes structure for table Organization
  89. -- ----------------------------
  90. -- ----------------------------
  91. -- Primary Key structure for table Organization
  92. -- ----------------------------
  93. ALTER TABLE [dbo].[Organization] ADD PRIMARY KEY ([ID])
  94. GO