/****** Object:  Table [dbo].[DROUsages]    Script Date: 01/19/2011 13:22:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DROUsages](
	[DROUsageID] [int] IDENTITY(1,1) NOT NULL,
	[DocID] [int] NOT NULL CONSTRAINT [DF_Table_1_ContentID]  DEFAULT ((0)),
	[ROID] [nvarchar](16) NOT NULL,
	[Config] [nvarchar](max) NULL,
	[DTS] [datetime] NOT NULL CONSTRAINT [DF_DROUsages_DTS]  DEFAULT (getdate()),
	[UserID] [nvarchar](100) NOT NULL CONSTRAINT [DF_DROUsages_UserID]  DEFAULT (upper(suser_sname())),
	[LastChanged] [timestamp] NOT NULL,
	[RODbID] [int] NOT NULL,
 CONSTRAINT [PK_DROUsages] PRIMARY KEY CLUSTERED 
(
	[DROUsageID] 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'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DROUsages', @level2type=N'COLUMN',@level2name=N'DTS'
GO
ALTER TABLE [dbo].[DROUsages]  WITH CHECK ADD  CONSTRAINT [FK_DROUsages_Documents] FOREIGN KEY([DocID])
REFERENCES [dbo].[Documents] ([DocID])
GO
ALTER TABLE [dbo].[DROUsages] CHECK CONSTRAINT [FK_DROUsages_Documents]
GO
ALTER TABLE [dbo].[DROUsages]  WITH CHECK ADD  CONSTRAINT [FK_DROUsages_RODbs] FOREIGN KEY([RODbID])
REFERENCES [dbo].[RODbs] ([RODbID])
GO
ALTER TABLE [dbo].[DROUsages] CHECK CONSTRAINT [FK_DROUsages_RODbs]