Source project | Target database |
---|
1 | SET ANSI_NULLS ON | 1 | SET ANSI_NULLS ON |
2 | SET QUOTED_IDENTIFIER ON | 2 | SET QUOTED_IDENTIFIER ON |
3 | | 3 | |
4 | GO | 4 | GO |
5 | CREATE TABLE [Person].[Person] ( | 5 | CREATE TABLE [Person].[Person] ( |
6 | [BusinessEntityID] [int] NOT NULL, | 6 | [BusinessEntityID] [int] NOT NULL, |
7 | [PersonType] [nchar](2) NOT NULL, | 7 | [PersonType] [nchar](2) NOT NULL, |
8 | [NameStyle] [dbo].[NameStyle] NOT NULL, | 8 | [NameStyle] [dbo].[NameStyle] NOT NULL, |
9 | [Title] [nvarchar](8) NULL, | 9 | [Title] [nvarchar](8) NULL, |
10 | [FirstName] [dbo].[Name] NOT NULL, | 10 | [FirstName] [dbo].[Name] NOT NULL, |
11 | [MiddleName] [dbo].[Name] NULL, | 11 | [MiddleName] [dbo].[Name] NULL, |
12 | [LastName] [dbo].[Name] NOT NULL, | 12 | [LastName] [dbo].[Name] NOT NULL, |
13 | [Suffix] [nvarchar](10) NULL, | 13 | [Suffix] [nvarchar](10) NULL, |
14 | [EmailPromotion] [int] NOT NULL, | 14 | [EmailPromotion] [int] NOT NULL, |
15 | [AdditionalContactInfo] [xml](CONTENT [Person].[AdditionalContactInfoSchemaCollection]) NULL, | 15 | [AdditionalContactInfo] [xml](CONTENT [Person].[AdditionalContactInfoSchemaCollection]) NULL, |
16 | [Demographics] [xml](CONTENT [Person].[IndividualSurveySchemaCollection]) NULL, | 16 | [Demographics] [xml](CONTENT [Person].[IndividualSurveySchemaCollection]) NULL, |
17 | [rowguid] [uniqueidentifier] NOT NULL ROWGUIDCOL, | 17 | [rowguid] [uniqueidentifier] NOT NULL ROWGUIDCOL, |
18 | [ModifiedDate] [datetime] NOT NULL | 18 | [ModifiedDate] [datetime] NOT NULL |
19 | ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] | 19 | ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] |
20 | GO | 20 | GO |
21 | ALTER TABLE [Person].[Person] | 21 | ALTER TABLE [Person].[Person] |
22 | ADD | 22 | ADD |
23 | CONSTRAINT [PK_Person_BusinessEntityID] | 23 | CONSTRAINT [PK_Person_BusinessEntityID] |
24 | PRIMARY KEY | 24 | PRIMARY KEY |
25 | CLUSTERED | 25 | CLUSTERED |
26 | ([BusinessEntityID]) | 26 | ([BusinessEntityID]) |
27 | ON [PRIMARY] | 27 | ON [PRIMARY] |
28 | GO | 28 | GO |
29 | ALTER TABLE [Person].[Person] | 29 | ALTER TABLE [Person].[Person] |
30 | ADD | 30 | ADD |
31 | CONSTRAINT [CK_Person_EmailPromotion] | 31 | CONSTRAINT [CK_Person_EmailPromotion] |
32 | CHECK | 32 | CHECK |
33 | ([EmailPromotion]>=(0) AND [EmailPromotion]<=(2)) | 33 | ([EmailPromotion]>=(0) AND [EmailPromotion]<=(2)) |
34 | GO | 34 | GO |
35 | ALTER TABLE [Person].[Person] | 35 | ALTER TABLE [Person].[Person] |
36 | CHECK CONSTRAINT [CK_Person_EmailPromotion] | 36 | CHECK CONSTRAINT [CK_Person_EmailPromotion] |
37 | GO | 37 | GO |
38 | ALTER TABLE [Person].[Person] | 38 | ALTER TABLE [Person].[Person] |
39 | ADD | 39 | ADD |
40 | CONSTRAINT [CK_Person_PersonType] | 40 | CONSTRAINT [CK_Person_PersonType] |
41 | CHECK | 41 | CHECK |
42 | ([PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC')) | 42 | ([PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC')) |
43 | GO | 43 | GO |
44 | ALTER TABLE [Person].[Person] | 44 | ALTER TABLE [Person].[Person] |
45 | CHECK CONSTRAINT [CK_Person_PersonType] | 45 | CHECK CONSTRAINT [CK_Person_PersonType] |
46 | GO | 46 | GO |
47 | ALTER TABLE [Person].[Person] | 47 | ALTER TABLE [Person].[Person] |
48 | ADD | 48 | ADD |
49 | CONSTRAINT [DF_Person_EmailPromotion] | 49 | CONSTRAINT [DF_Person_EmailPromotion] |
50 | DEFAULT ((0)) FOR [EmailPromotion] | 50 | DEFAULT ((0)) FOR [EmailPromotion] |
51 | GO | 51 | GO |
52 | ALTER TABLE [Person].[Person] | 52 | ALTER TABLE [Person].[Person] |
53 | ADD | 53 | ADD |
54 | CONSTRAINT [DF_Person_ModifiedDate] | 54 | CONSTRAINT [DF_Person_ModifiedDate] |
55 | DEFAULT (getdate()) FOR [ModifiedDate] | 55 | DEFAULT (getdate()) FOR [ModifiedDate] |
56 | GO | 56 | GO |
57 | ALTER TABLE [Person].[Person] | 57 | ALTER TABLE [Person].[Person] |
58 | ADD | 58 | ADD |
59 | CONSTRAINT [DF_Person_NameStyle] | 59 | CONSTRAINT [DF_Person_NameStyle] |
60 | DEFAULT ((0)) FOR [NameStyle] | 60 | DEFAULT ((0)) FOR [NameStyle] |
61 | GO | 61 | GO |
62 | ALTER TABLE [Person].[Person] | 62 | ALTER TABLE [Person].[Person] |
63 | ADD | 63 | ADD |
64 | CONSTRAINT [DF_Person_rowguid] | 64 | CONSTRAINT [DF_Person_rowguid] |
65 | DEFAULT (newid()) FOR [rowguid] | 65 | DEFAULT (newid()) FOR [rowguid] |
66 | GO | 66 | GO |
67 | ALTER TABLE [Person].[Person] | 67 | ALTER TABLE [Person].[Person] |
68 | WITH CHECK | 68 | WITH CHECK |
69 | ADD CONSTRAINT [FK_Person_BusinessEntity_BusinessEntityID] | 69 | ADD CONSTRAINT [FK_Person_BusinessEntity_BusinessEntityID] |
70 | FOREIGN KEY ([BusinessEntityID]) REFERENCES [Person].[BusinessEntity] ([BusinessEntityID]) | 70 | FOREIGN KEY ([BusinessEntityID]) REFERENCES [Person].[BusinessEntity] ([BusinessEntityID]) |
71 | ALTER TABLE [Person].[Person] | 71 | ALTER TABLE [Person].[Person] |
72 | CHECK CONSTRAINT [FK_Person_BusinessEntity_BusinessEntityID] | 72 | CHECK CONSTRAINT [FK_Person_BusinessEntity_BusinessEntityID] |
73 | | 73 | |
74 | GO | 74 | GO |
75 | CREATE UNIQUE NONCLUSTERED INDEX [AK_Person_rowguid] | 75 | CREATE UNIQUE NONCLUSTERED INDEX [AK_Person_rowguid] |
76 | ON [Person].[Person] ([rowguid]) | 76 | ON [Person].[Person] ([rowguid]) |
77 | ON [PRIMARY] | 77 | ON [PRIMARY] |
78 | GO | 78 | GO |
79 | CREATE NONCLUSTERED INDEX [IX_Person_LastName_FirstName_MiddleName] | 79 | CREATE NONCLUSTERED INDEX [IX_Person_LastName_FirstName_MiddleName] |
80 | ON [Person].[Person] ([LastName], [FirstName], [MiddleName]) | 80 | ON [Person].[Person] ([LastName], [FirstName], [MiddleName]) |
81 | ON [PRIMARY] | 81 | ON [PRIMARY] |
| | 82 | GO |
| | 83 | CREATE NONCLUSTERED INDEX [IX_Person_ModifiedDate] |
| | 84 | ON [Person].[Person] ([ModifiedDate] DESC) |
| | 85 | ON [PRIMARY] |
82 | GO | 86 | GO |
83 | CREATE PRIMARY XML INDEX [PXML_Person_AddContact] | 87 | CREATE PRIMARY XML INDEX [PXML_Person_AddContact] |
84 | ON [Person].[Person] ([AdditionalContactInfo]) | 88 | ON [Person].[Person] ([AdditionalContactInfo]) |
85 | GO | 89 | GO |
86 | CREATE PRIMARY XML INDEX [PXML_Person_Demographics] | 90 | CREATE PRIMARY XML INDEX [PXML_Person_Demographics] |
87 | ON [Person].[Person] ([Demographics]) | 91 | ON [Person].[Person] ([Demographics]) |
88 | GO | 92 | GO |
89 | CREATE XML INDEX [XMLPATH_Person_Demographics] | 93 | CREATE XML INDEX [XMLPATH_Person_Demographics] |
90 | ON [Person].[Person] ([Demographics]) | 94 | ON [Person].[Person] ([Demographics]) |
91 | USING XML INDEX [PXML_Person_Demographics] | 95 | USING XML INDEX [PXML_Person_Demographics] |
92 | FOR PATH | 96 | FOR PATH |
93 | GO | 97 | GO |
94 | CREATE XML INDEX [XMLPROPERTY_Person_Demographics] | 98 | CREATE XML INDEX [XMLPROPERTY_Person_Demographics] |
95 | ON [Person].[Person] ([Demographics]) | 99 | ON [Person].[Person] ([Demographics]) |
96 | USING XML INDEX [PXML_Person_Demographics] | 100 | USING XML INDEX [PXML_Person_Demographics] |
97 | FOR PROPERTY | 101 | FOR PROPERTY |
98 | GO | 102 | GO |
99 | CREATE XML INDEX [XMLVALUE_Person_Demographics] | 103 | CREATE XML INDEX [XMLVALUE_Person_Demographics] |
100 | ON [Person].[Person] ([Demographics]) | 104 | ON [Person].[Person] ([Demographics]) |
101 | USING XML INDEX [PXML_Person_Demographics] | 105 | USING XML INDEX [PXML_Person_Demographics] |
102 | FOR VALUE | 106 | FOR VALUE |
103 | GO | 107 | GO |
104 | ALTER TABLE [Person].[Person] SET (LOCK_ESCALATION = TABLE) | 108 | ALTER TABLE [Person].[Person] SET (LOCK_ESCALATION = TABLE) |
105 | GO | 109 | GO |
106 | | 110 | |