/****** Object: Table [dbo].[AgentSynonymisationType_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentSynonymisationType_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_AgentSynonymisationType_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A text code that uniquely identifies each object in the enumeration (primary key). This value may not be changed, because the application may depend upon it.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'Code' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Description of enumerated object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'Description' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Short abbreviated description of the object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayText' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The order in which the entries are displayed. The order may be changed at any time, but all values must be unique.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayOrder' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Enumerated objects can be hidden from the user interface if this attribute is set to false (= unchecked check box)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayEnable' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Internal development notes about usage, definition, etc. of an enumerated object' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'InternalNotes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The code of the superior entry, if a hierarchy within the entries is necessary' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentSynonymisationType_Enum', @level2type=N'COLUMN',@level2name=N'ParentCode' GO /****** Object: Table [dbo].[AgentTitle_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentTitle_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_AgentTitle_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The code of the superior entry, if a hierarchy within the entries is necessary' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentTitle_Enum', @level2type=N'COLUMN',@level2name=N'ParentCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Lookup table for the titles of the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentTitle_Enum' GO /****** Object: Table [dbo].[AgentType_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentType_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_AgentType_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The code of the superior entry, if a hierarchy within the entries is necessary' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentType_Enum', @level2type=N'COLUMN',@level2name=N'ParentCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Lookup table for the types of the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentType_Enum' GO /****** Object: Table [dbo].[Agent] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Agent]( [AgentID] [int] IDENTITY(1,1) NOT NULL, [AgentParentID] [int] NULL, [AgentName] [nvarchar](200) NOT NULL, [Version] [smallint] NOT NULL, [AgentTitle] [nvarchar](50) NULL, [GivenName] [nvarchar](255) NULL, [InheritedName] [nvarchar](255) NULL, [Abbreviation] [nvarchar](50) NULL, [AgentType] [nvarchar](50) NULL, [AgentRole] [nvarchar](255) NULL, [Description] [nvarchar](1000) NULL, [Notes] [nvarchar](500) NULL, [ValidFromDate] [datetime] NULL, [ValidFromDay] [tinyint] NULL, [ValidFromMonth] [tinyint] NULL, [ValidFromYear] [smallint] NULL, [ValidUntilDate] [datetime] NULL, [ValidUntilDay] [tinyint] NULL, [ValidUntilMonth] [tinyint] NULL, [ValidUntilYear] [smallint] NULL, [ValidDateSupplement] [nvarchar](255) NULL, [SynonymToAgentID] [int] NULL, [SynonymisationType] [nvarchar](50) NULL, [RevisionLevel] [nvarchar](50) NULL, [LogUpdatedBy] [nvarchar](50) NULL, [LogUpdatedWhen] [smalldatetime] NULL, CONSTRAINT [PK_Agent] PRIMARY KEY CLUSTERED ( [AgentID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique ID for the Agent (= Primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The AgentID of the superior agent if agents are organized within a hierarchy' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentParentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The whole name of the agent as shown e.g. for selection in an user interface. For persons this entry will be generated as follows: LastName, FirstNames, AgentTitle' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The version of a agent record (revision number, internally filled by system)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'Version' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The title of the agent, e.g. Dr., Prof.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentTitle' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The first names of the agent (if a person) or the name of e.g. an institution' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'GivenName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The last names of the agent (if a person)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'InheritedName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Abbreviation of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'Abbreviation' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The type of the agent, e.g. person, company' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentType' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The role of an agent esp. a person within an organization. e.g. "Database Administrator" or "Curator"' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'AgentRole' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A description of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'Description' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Notes about the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'Notes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date of the begin of the exsistence of the agent, e.g. the birthday of a person or the founding of an institution, calculated from ValidFromDay, - Month and -Year' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidFromDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The day of the begin of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidFromDay' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month of the begin of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidFromMonth' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The year of the begin of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidFromYear' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date of the end of the exsistence of the agent, e.g. death of a person or closing of an institute, calculated from ValidUntilDay, - Month and -Year' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidUntilDate' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The day of the end of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidUntilDay' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The month of the end of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidUntilMonth' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The year of the end of the exsistence of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidUntilYear' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Verbal or additional date information, e.g. ''end of summer 1985'', ''first quarter''. The time of the valid date if necessary.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'ValidDateSupplement' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The AgentID of the agent which was selected as a replacement for the current agent, e.g. if to equal datasets were imported from different sources' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'SynonymToAgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The level of the revision of the agent, e.g. ''unchecked'', ''final revision''' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'RevisionLevel' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Name of user who last updated the data.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'LogUpdatedBy' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time when the data were last updated.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent', @level2type=N'COLUMN',@level2name=N'LogUpdatedWhen' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The main table with the data of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Agent' GO /****** Object: Table [dbo].[AgentKeyword] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentKeyword]( [AgentID] [int] NOT NULL, [Keyword] [nvarchar](200) NOT NULL, CONSTRAINT [PK_AgentKeyword] PRIMARY KEY CLUSTERED ( [AgentID] ASC, [Keyword] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique ID for the Agent (foreign key + part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentKeyword', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The keyword' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentKeyword', @level2type=N'COLUMN',@level2name=N'Keyword' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The keywords for the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentKeyword' GO /****** Object: Table [dbo].[AgentImage] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[AgentImage]( [AgentID] [int] NOT NULL, [URI] [varchar](255) NOT NULL, CONSTRAINT [PK_AgentImage] PRIMARY KEY CLUSTERED ( [AgentID] ASC, [URI] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique ID for the Agent (foreign key + part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentImage', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The complete URI address of the image. This is only a cached value if ResourceID is available referring to the module DiversityResources' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentImage', @level2type=N'COLUMN',@level2name=N'URI' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The images of the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentImage' GO /****** Object: Table [dbo].[AgentNameDisplayType_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentNameDisplayType_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_AgentNameDisplayType_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A text code that uniquely identifies each object in the enumeration (primary key). This value may not be changed, because the application may depend upon it.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'Code' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Description of enumerated object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'Description' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Short abbreviated description of the object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayText' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The order in which the entries are displayed. The order may be changed at any time, but all values must be unique.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayOrder' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Enumerated objects can be hidden from the user interface if this attribute is set to false (= unchecked check box)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayEnable' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Internal development notes about usage, definition, etc. of an enumerated object' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'InternalNotes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The code of the superior entry, if a hierarchy within the entries is necessary' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentNameDisplayType_Enum', @level2type=N'COLUMN',@level2name=N'ParentCode' GO /****** Object: Table [dbo].[AgentExternalDatabase] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentExternalDatabase]( [ExternalDatabaseID] [int] NOT NULL, [ExternalDatabaseName] [nvarchar](100) NULL, [ExternalDatabaseVersion] [nvarchar](255) NULL, [Rights] [nvarchar](500) NULL, [ExternalDatabaseAuthors] [nvarchar](200) NULL, [ExternalDatabaseURI] [nvarchar](300) NULL, [ExternalDatabaseInstitution] [nvarchar](300) NULL, [InternalNotes] [nvarchar](1500) NULL, [ExternalAttribute_AgentID] [nvarchar](255) NULL, [PreferredSequence] [tinyint] NULL, [Disabled] [bit] NULL, CONSTRAINT [PK_AgentExternalDatabase] PRIMARY KEY CLUSTERED ( [ExternalDatabaseID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'An ID to identify an external data collection of plant names (primary key, the ID has no meaning outside of the DiversityWorkbench system)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the data collection that has been integrated or can be linked to for further analysis' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The version of this data collection (either official version number, or dates when the collection was integrated)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseVersion' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A description of copyright agreements or permission to use data from the external database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'Rights' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The persons or institutions responsible for the external database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseAuthors' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The link to the database provider resp. the external database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseURI' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The institution responsible for the external database' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseInstitution' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Additional notes concerning this data collection' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'InternalNotes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The table and field name in the external data collection to which PlantNameAnalysis.ExternalNameID refers' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'ExternalAttribute_AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'For selection in e.g. picklists: of several equal names only the name from the source with the lowest preferred sequence will be provided.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'PreferredSequence' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'If this source should be disabled for selection of names e.g. in picklists' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase', @level2type=N'COLUMN',@level2name=N'Disabled' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The external databases from which data in the database may have been imported from' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalDatabase' GO /****** Object: Table [dbo].[AgentExternalID] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[AgentExternalID]( [AgentID] [int] NOT NULL, [ExternalDatabaseID] [int] NOT NULL, [ExternalAgentURI] [varchar](255) NULL, CONSTRAINT [PK_AgentExternalID] PRIMARY KEY CLUSTERED ( [AgentID] ASC, [ExternalDatabaseID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique ID for the Agent (foreign key + part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalID', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID of an external taxonomic data collection as defined in AgentExternalDatabase (foreign key + part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalID', @level2type=N'COLUMN',@level2name=N'ExternalDatabaseID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The URI (e.g. LSID) of the external agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalID', @level2type=N'COLUMN',@level2name=N'ExternalAgentURI' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID''s of data that were imported from foreign souces' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentExternalID' GO /****** Object: Table [dbo].[AddressType_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AddressType_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_AddressType_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A text code that uniquely identifies each object in the enumeration (primary key). This value may not be changed, because the application may depend upon it.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'Code' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Description of enumerated object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'Description' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Short abbreviated description of the object, displayed in the user interface' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayText' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The order in which the entries are displayed. The order may be changed at any time, but all values must be unique.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayOrder' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Enumerated objects can be hidden from the user interface if this attribute is set to false (= unchecked check box)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'DisplayEnable' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Internal development notes about usage, definition, etc. of an enumerated object' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'InternalNotes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The code of the superior entry, if a hierarchy within the entries is necessary' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum', @level2type=N'COLUMN',@level2name=N'ParentCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Lookup table for the types of the addresses' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AddressType_Enum' GO /****** Object: Table [dbo].[AgentContactInformation] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentContactInformation]( [AgentID] [int] NOT NULL, [DisplayOrder] [tinyint] NOT NULL, [AddressType] [nvarchar](50) NULL, [Country] [nvarchar](255) NULL, [City] [nvarchar](255) NULL, [PostalCode] [nvarchar](50) NULL, [Streetaddress] [nvarchar](255) NULL, [Address] [nvarchar](255) NULL, [Telephone] [nvarchar](50) NULL, [CellularPhone] [nvarchar](50) NULL, [Telefax] [nvarchar](50) NULL, [Email] [nvarchar](255) NULL, [URI] [nvarchar](255) NULL, [Notes] [nvarchar](255) NULL, [ValidFrom] [datetime] NULL, [ValidUntil] [datetime] NULL, [LogUpdatedBy] [nvarchar](50) NULL, [LogUpdatedWhen] [smalldatetime] NULL, CONSTRAINT [PK_AgentAddress] PRIMARY KEY CLUSTERED ( [AgentID] ASC, [DisplayOrder] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Refers to the ID of Agent (= Foreign key and part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Display order of records in user interface. DisplayOrder 1 corresponds to the preferred address (= part of primary key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'DisplayOrder' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Type of the adress, e.g. private' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'AddressType' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Country of the address' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Country' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'City of the address' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'City' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ZIP or postcode of the address (usually output before or after the city)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'PostalCode' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Usually street name and number, but may also contain post office box' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Streetaddress' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Free text postal address of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Address' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Phone number, including area code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Telephone' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The number of a mobile telephone device of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'CellularPhone' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Fax number, including area code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Telefax' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'E-mail address of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Email' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'URI pointing to a homepage containing further information' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'URI' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Notes about this address' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'Notes' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date when this address became valid as date according to ISO 8601' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'ValidFrom' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The date of the expiration of the validity of this address as date according to ISO 8601' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'ValidUntil' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Name of user who last updated the data.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'LogUpdatedBy' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time when the data were last updated.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation', @level2type=N'COLUMN',@level2name=N'LogUpdatedWhen' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The contact information resp. addresses of the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentContactInformation' GO /****** Object: Table [dbo].[RevisionLevel_Enum] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[RevisionLevel_Enum]( [Code] [nvarchar](50) NOT NULL, [Description] [nvarchar](500) NULL, [DisplayText] [nvarchar](50) NULL, [DisplayOrder] [smallint] NULL, [DisplayEnable] [bit] NULL, [InternalNotes] [nvarchar](500) NULL, [ParentCode] [nvarchar](50) NULL, CONSTRAINT [PK_RevisionLevel_Enum] PRIMARY KEY CLUSTERED ( [Code] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Lookup table for the revision level' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'RevisionLevel_Enum' GO /****** Object: Table [dbo].[ProjectProxy] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ProjectProxy]( [ProjectID] [int] NOT NULL, [Project] [nvarchar](50) NOT NULL, [AgentNameDisplayType] [nvarchar](50) NULL, CONSTRAINT [PK_ProjetProxy] PRIMARY KEY CLUSTERED ( [ProjectID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID of the project, Primary key' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectProxy', @level2type=N'COLUMN',@level2name=N'ProjectID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name of the project as stored in the module DiversityProjects' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectProxy', @level2type=N'COLUMN',@level2name=N'Project' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The display type of the name of the agent' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectProxy', @level2type=N'COLUMN',@level2name=N'AgentNameDisplayType' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The projects - refers to database DiversityProjects' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectProxy' GO /****** Object: Table [dbo].[AgentProject] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[AgentProject]( [AgentID] [int] NOT NULL, [ProjectID] [int] NOT NULL, CONSTRAINT [PK_AgentProject] PRIMARY KEY CLUSTERED ( [AgentID] ASC, [ProjectID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique ID for the Agent (= Foreign key)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentProject', @level2type=N'COLUMN',@level2name=N'AgentID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID of the project' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentProject', @level2type=N'COLUMN',@level2name=N'ProjectID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The projects of the agents' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'AgentProject' GO /****** Object: Table [dbo].[UserProxy] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[UserProxy]( [LoginName] [nvarchar](50) NOT NULL, [CombinedNameCache] [nvarchar](50) NULL, [UserURI] [varchar](255) NULL, [ProjectID] [int] NULL, CONSTRAINT [PK_UserProxy] PRIMARY KEY CLUSTERED ( [LoginName] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The login name of the user, Primary key' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserProxy', @level2type=N'COLUMN',@level2name=N'LoginName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A combined name of the user, created on the base of an entry in the module DiversityUsers' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserProxy', @level2type=N'COLUMN',@level2name=N'CombinedNameCache' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Refers to UserInfo.UserID in database DiversityUsers' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserProxy', @level2type=N'COLUMN',@level2name=N'UserURI' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID of the default project of the user as stored in table ProjectProxy' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserProxy', @level2type=N'COLUMN',@level2name=N'ProjectID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The user logins - refers to database DiversityUsers' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserProxy' GO /****** Object: Table [dbo].[ProjectUser] Script Date: 10/22/2009 14:35:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ProjectUser]( [LoginName] [nvarchar](50) NOT NULL, [ProjectID] [int] NOT NULL, CONSTRAINT [PK_ProjectUser] PRIMARY KEY CLUSTERED ( [LoginName] ASC, [ProjectID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The login name of the user' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectUser', @level2type=N'COLUMN',@level2name=N'LoginName' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The ID of the default project of the user as stored in table ProjectProxy' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectUser', @level2type=N'COLUMN',@level2name=N'ProjectID' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The projects to which users have access to' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ProjectUser' GO /****** Object: Default [DF_Agent_AgentName] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_AgentName] DEFAULT ('') FOR [AgentName] GO /****** Object: Default [DF_Agent_Version] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_Version] DEFAULT ((1)) FOR [Version] GO /****** Object: Default [DF_Agent_AgentType] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_AgentType] DEFAULT (N'person') FOR [AgentType] GO /****** Object: Default [DF_Agent_RevisionLevel] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_RevisionLevel] DEFAULT (N'unchecked') FOR [RevisionLevel] GO /****** Object: Default [DF_Agent_LogUpdatedBy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_LogUpdatedBy] DEFAULT (user_name()) FOR [LogUpdatedBy] GO /****** Object: Default [DF_Agent_LogUpdatedWhen] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] ADD CONSTRAINT [DF_Agent_LogUpdatedWhen] DEFAULT (getdate()) FOR [LogUpdatedWhen] GO /****** Object: Default [DF_AgentContactInformation_LogUpdatedBy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentContactInformation] ADD CONSTRAINT [DF_AgentContactInformation_LogUpdatedBy] DEFAULT (user_name()) FOR [LogUpdatedBy] GO /****** Object: Default [DF_AgentContactInformation_LogUpdatedWhen] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentContactInformation] ADD CONSTRAINT [DF_AgentContactInformation_LogUpdatedWhen] DEFAULT (getdate()) FOR [LogUpdatedWhen] GO /****** Object: Default [DF_AgentExternalID_ExternalDatabaseID] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentExternalID] ADD CONSTRAINT [DF_AgentExternalID_ExternalDatabaseID] DEFAULT ('') FOR [ExternalDatabaseID] GO /****** Object: Default [DF_AgentProject_ProjectID] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentProject] ADD CONSTRAINT [DF_AgentProject_ProjectID] DEFAULT (0) FOR [ProjectID] GO /****** Object: ForeignKey [FK_Agent_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] WITH NOCHECK ADD CONSTRAINT [FK_Agent_Agent] FOREIGN KEY([AgentParentID]) REFERENCES [dbo].[Agent] ([AgentID]) GO ALTER TABLE [dbo].[Agent] CHECK CONSTRAINT [FK_Agent_Agent] GO /****** Object: ForeignKey [FK_Agent_AgentSynonymisationType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] WITH CHECK ADD CONSTRAINT [FK_Agent_AgentSynonymisationType_Enum] FOREIGN KEY([SynonymisationType]) REFERENCES [dbo].[AgentSynonymisationType_Enum] ([Code]) GO ALTER TABLE [dbo].[Agent] CHECK CONSTRAINT [FK_Agent_AgentSynonymisationType_Enum] GO /****** Object: ForeignKey [FK_Agent_AgentTitle_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] WITH NOCHECK ADD CONSTRAINT [FK_Agent_AgentTitle_Enum] FOREIGN KEY([AgentTitle]) REFERENCES [dbo].[AgentTitle_Enum] ([Code]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[Agent] CHECK CONSTRAINT [FK_Agent_AgentTitle_Enum] GO /****** Object: ForeignKey [FK_Agent_AgentType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[Agent] WITH NOCHECK ADD CONSTRAINT [FK_Agent_AgentType_Enum] FOREIGN KEY([AgentType]) REFERENCES [dbo].[AgentType_Enum] ([Code]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[Agent] CHECK CONSTRAINT [FK_Agent_AgentType_Enum] GO /****** Object: ForeignKey [FK_AgentContactInformation_AddressType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentContactInformation] WITH CHECK ADD CONSTRAINT [FK_AgentContactInformation_AddressType_Enum] FOREIGN KEY([AddressType]) REFERENCES [dbo].[AddressType_Enum] ([Code]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[AgentContactInformation] CHECK CONSTRAINT [FK_AgentContactInformation_AddressType_Enum] GO /****** Object: ForeignKey [FK_AgentContactInformation_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentContactInformation] WITH CHECK ADD CONSTRAINT [FK_AgentContactInformation_Agent] FOREIGN KEY([AgentID]) REFERENCES [dbo].[Agent] ([AgentID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentContactInformation] CHECK CONSTRAINT [FK_AgentContactInformation_Agent] GO /****** Object: ForeignKey [FK_AgentExternalID_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentExternalID] WITH NOCHECK ADD CONSTRAINT [FK_AgentExternalID_Agent] FOREIGN KEY([AgentID]) REFERENCES [dbo].[Agent] ([AgentID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentExternalID] CHECK CONSTRAINT [FK_AgentExternalID_Agent] GO /****** Object: ForeignKey [FK_AgentExternalID_AgentExternalDatabase] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentExternalID] WITH CHECK ADD CONSTRAINT [FK_AgentExternalID_AgentExternalDatabase] FOREIGN KEY([ExternalDatabaseID]) REFERENCES [dbo].[AgentExternalDatabase] ([ExternalDatabaseID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentExternalID] CHECK CONSTRAINT [FK_AgentExternalID_AgentExternalDatabase] GO /****** Object: ForeignKey [FK_AgentImage_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentImage] WITH CHECK ADD CONSTRAINT [FK_AgentImage_Agent] FOREIGN KEY([AgentID]) REFERENCES [dbo].[Agent] ([AgentID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentImage] CHECK CONSTRAINT [FK_AgentImage_Agent] GO /****** Object: ForeignKey [FK_AgentKeyword_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentKeyword] WITH NOCHECK ADD CONSTRAINT [FK_AgentKeyword_Agent] FOREIGN KEY([AgentID]) REFERENCES [dbo].[Agent] ([AgentID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentKeyword] CHECK CONSTRAINT [FK_AgentKeyword_Agent] GO /****** Object: ForeignKey [FK_AgentNameDisplayType_Enum_AgentNameDisplayType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentNameDisplayType_Enum] WITH CHECK ADD CONSTRAINT [FK_AgentNameDisplayType_Enum_AgentNameDisplayType_Enum] FOREIGN KEY([ParentCode]) REFERENCES [dbo].[AgentNameDisplayType_Enum] ([Code]) GO ALTER TABLE [dbo].[AgentNameDisplayType_Enum] CHECK CONSTRAINT [FK_AgentNameDisplayType_Enum_AgentNameDisplayType_Enum] GO /****** Object: ForeignKey [FK_AgentProject_Agent] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentProject] WITH NOCHECK ADD CONSTRAINT [FK_AgentProject_Agent] FOREIGN KEY([AgentID]) REFERENCES [dbo].[Agent] ([AgentID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[AgentProject] CHECK CONSTRAINT [FK_AgentProject_Agent] GO /****** Object: ForeignKey [FK_AgentProject_ProjetProxy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentProject] WITH CHECK ADD CONSTRAINT [FK_AgentProject_ProjetProxy] FOREIGN KEY([ProjectID]) REFERENCES [dbo].[ProjectProxy] ([ProjectID]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[AgentProject] CHECK CONSTRAINT [FK_AgentProject_ProjetProxy] GO /****** Object: ForeignKey [FK_AgentSynonymisationType_Enum_AgentSynonymisationType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[AgentSynonymisationType_Enum] WITH CHECK ADD CONSTRAINT [FK_AgentSynonymisationType_Enum_AgentSynonymisationType_Enum] FOREIGN KEY([ParentCode]) REFERENCES [dbo].[AgentSynonymisationType_Enum] ([Code]) GO ALTER TABLE [dbo].[AgentSynonymisationType_Enum] CHECK CONSTRAINT [FK_AgentSynonymisationType_Enum_AgentSynonymisationType_Enum] GO /****** Object: ForeignKey [FK_ProjectProxy_AgentNameDisplayType_Enum] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[ProjectProxy] WITH CHECK ADD CONSTRAINT [FK_ProjectProxy_AgentNameDisplayType_Enum] FOREIGN KEY([AgentNameDisplayType]) REFERENCES [dbo].[AgentNameDisplayType_Enum] ([Code]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[ProjectProxy] CHECK CONSTRAINT [FK_ProjectProxy_AgentNameDisplayType_Enum] GO /****** Object: ForeignKey [FK_ProjectUser_ProjetProxy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[ProjectUser] WITH NOCHECK ADD CONSTRAINT [FK_ProjectUser_ProjetProxy] FOREIGN KEY([ProjectID]) REFERENCES [dbo].[ProjectProxy] ([ProjectID]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[ProjectUser] CHECK CONSTRAINT [FK_ProjectUser_ProjetProxy] GO /****** Object: ForeignKey [FK_ProjectUser_UserProxy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[ProjectUser] WITH CHECK ADD CONSTRAINT [FK_ProjectUser_UserProxy] FOREIGN KEY([LoginName]) REFERENCES [dbo].[UserProxy] ([LoginName]) ON UPDATE CASCADE ON DELETE CASCADE GO ALTER TABLE [dbo].[ProjectUser] CHECK CONSTRAINT [FK_ProjectUser_UserProxy] GO /****** Object: ForeignKey [FK_UserProxy_ProjectProxy] Script Date: 10/22/2009 14:35:58 ******/ ALTER TABLE [dbo].[UserProxy] WITH CHECK ADD CONSTRAINT [FK_UserProxy_ProjectProxy] FOREIGN KEY([ProjectID]) REFERENCES [dbo].[ProjectProxy] ([ProjectID]) GO ALTER TABLE [dbo].[UserProxy] CHECK CONSTRAINT [FK_UserProxy_ProjectProxy] GO