医院跟踪系统表.sql 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. USE [LYFZERPDB]
  2. GO
  3. /****** Object: Table [dbo].[tb_ErpHospitalDispatchDoor] Script Date: 10/06/2015 14:08:55 ******/
  4. IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalDispatchDoor]') AND type in (N'U'))
  5. begin
  6. IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalClient]') AND type in (N'U'))
  7. DROP TABLE [dbo].[tb_ErpHospitalClient]
  8. IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalContactRecord]') AND type in (N'U'))
  9. DROP TABLE [dbo].[tb_ErpHospitalContactRecord]
  10. end
  11. GO
  12. IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalDispatchDoor]') AND type in (N'U'))
  13. begin
  14. CREATE TABLE [dbo].[tb_ErpHospitalDispatchDoor](
  15. [id] [int] IDENTITY(1,1) NOT NULL,
  16. [Hdr_Number] [nvarchar](20) NULL,
  17. [Hdr_DoorTime] [datetime] NULL,
  18. [Hdr_DoorPeriod] [varchar](10) NULL,
  19. [Hdr_HomeState] [int] NULL,
  20. [Hdr_DoorPersonOne] [varchar](20) NULL,
  21. [Hdr_DoorPersonTwo] [varchar](20) NULL,
  22. [Hdr_Vehicle] [varchar](10) NULL,
  23. [Hdr_DoorPersonThree] [varchar](50) NULL,
  24. [Hdr_DoorPersonFour] [varchar](20) NULL,
  25. [Hdr_CreateDatetime] [datetime] NULL,
  26. [Hdr_CreateName] [varchar](20) NULL,
  27. )
  28. ALTER TABLE [dbo].[tb_ErpHospitalDispatchDoor] ADD CONSTRAINT [PK__tb_ErpHospitalDi__565FA31D] PRIMARY KEY CLUSTERED
  29. (
  30. [id] ASC
  31. )
  32. end
  33. GO
  34. IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalClient]') AND type in (N'U'))
  35. begin
  36. CREATE TABLE [dbo].[tb_ErpHospitalClient](
  37. [ID] [int] IDENTITY(1,1) NOT NULL,
  38. [Hct_Oddnumber] [nvarchar](200) NOT NULL,
  39. [Hct_CustomerName] [nvarchar](20) NOT NULL,
  40. [Hct_BabyName] [nvarchar](20) NULL,
  41. [Hct_BabySex] [nvarchar](2) NULL,
  42. [Hct_BabyBirthday] [varchar](50) NULL,
  43. [Hct_AreLunar] [bit] NULL,
  44. [Hct_BirthdayType] [int] NULL,
  45. [Hct_MessageSingle] [nvarchar](2) NULL,
  46. [Hct_CustomerOrders] [int] NULL,
  47. [Hct_OrderNumber] [nvarchar](50) NULL,
  48. [Hct_BabyFeeding] [nvarchar](20) NULL,
  49. [Hct_CustomerRegions] [nvarchar](20) NULL,
  50. [Hct_CustomerGroups] [nvarchar](20) NULL,
  51. [Hct_DealStatus] [nvarchar](6) NULL,
  52. [Hct_SingleHospital] [nvarchar](200) NULL,
  53. [Hct_MyselfMobile] [nvarchar](200) NULL,
  54. [Hct_HusbandMobile] [nvarchar](200) NULL,
  55. [Hct_FamilyPhone] [nvarchar](200) NULL,
  56. [Hct_Husbandphone] [nvarchar](200) NULL,
  57. [Hct_Maidenphone] [nvarchar](200) NULL,
  58. [Hct_QQ] [nvarchar](50) NULL,
  59. [Hct_PregnantDay] [int] NULL,
  60. [Hct_Retail] [nvarchar](20) NULL,
  61. [Hct_Remarks] [nvarchar](800) NULL,
  62. [Hct_HomeAddress] [nvarchar](300) NULL,
  63. [Hct_HomePostcode] [nvarchar](200) NULL,
  64. [Hct_HusbandAddress] [nvarchar](300) NULL,
  65. [Hct_HusbandPostcode] [nvarchar](200) NULL,
  66. [Hct_MaidenAddress] [nvarchar](300) NULL,
  67. [Hct_MaidenPostcode] [nvarchar](200) NULL,
  68. [Hct_SingleDatetime] [datetime] NULL,
  69. [Hcr_BusinessType] [nvarchar](8) NULL,
  70. [Hct_BusinessIntention] [nvarchar](8) NULL,
  71. [Hct_CreateDatetime] [datetime] NULL,
  72. [Hct_CreateName] [nvarchar](20) NULL,
  73. [Hct_UpdateDatetime] [datetime] NULL,
  74. [Hct_UpdateName] [nvarchar](20) NULL,
  75. )
  76. ALTER TABLE [dbo].[tb_ErpHospitalClient] ADD CONSTRAINT [PK_tb_ErpHospitalClient] PRIMARY KEY CLUSTERED
  77. (
  78. [ID] ASC,
  79. [Hct_Oddnumber] ASC
  80. )
  81. end
  82. GO
  83. IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_ErpHospitalContactRecord]') AND type in (N'U'))
  84. begin
  85. CREATE TABLE [dbo].[tb_ErpHospitalContactRecord](
  86. [id] [int] IDENTITY(1,1) NOT NULL,
  87. [Hcr_Number] [nvarchar](20) NOT NULL,
  88. [Hcr_CallTime] [datetime] NULL,
  89. [Hcr_CallDuration] [int] NULL,
  90. [Hcr_CallType] [nvarchar](8) NULL,
  91. [Hcr_Homeaddress] [nvarchar](8) NOT NULL,
  92. [Hcr_CallStaff] [nvarchar](20) NULL,
  93. [Hcr_CallCases] [nvarchar](6) NULL,
  94. [Hcr_CallMode] [nvarchar](8) NULL,
  95. [Hcr_RemindTime] [datetime] NULL,
  96. [Hcr_Remarks] [nvarchar](800) NULL,
  97. [Hcr_CreateDatetime] [datetime] NULL,
  98. [Hcr_CreateName] [nvarchar](20) NULL,
  99. [Hcr_UpdateDatetime] [datetime] NULL,
  100. [Hcr_UpdateName] [nvarchar](20) NULL,
  101. )
  102. ALTER TABLE [dbo].[tb_ErpHospitalContactRecord] ADD CONSTRAINT [PK__tb_ErpHospitalCo__139DBB87] PRIMARY KEY CLUSTERED
  103. (
  104. [id] ASC,
  105. [Hcr_Number] ASC
  106. )
  107. end
  108. GO