/****** Object:  Table [dbo].[answers]    Script Date: 10/6/2004 8:44:30 PM ******/
CREATE TABLE [dbo].[answers] (
	[id] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[questionidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[answer] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[rank] [int] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[questions]    Script Date: 10/6/2004 8:44:32 PM ******/
CREATE TABLE [dbo].[questions] (
	[id] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[surveyidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[question] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[questiontypeidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[rank] [int] NOT NULL ,
	[required] [bit] NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[questiontypes]    Script Date: 10/6/2004 8:44:32 PM ******/
CREATE TABLE [dbo].[questiontypes] (
	[id] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[handlerroot] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[results]    Script Date: 10/6/2004 8:44:32 PM ******/
CREATE TABLE [dbo].[results] (
	[owneridfk] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[questionidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[answeridfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[truefalse] [bit] NULL ,
	[textbox] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[textboxmulti] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[other] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [itemidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[survey_emailaddresses]    Script Date: 10/6/2004 8:44:32 PM ******/
CREATE TABLE [dbo].[survey_emailaddresses] (
	[surveyidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[emailaddress] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[survey_results]    Script Date: 10/6/2004 8:44:32 PM ******/
CREATE TABLE [dbo].[survey_results] (
	[surveyidfk] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ownerid] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[completed] [datetime] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[answers] WITH NOCHECK ADD 
	CONSTRAINT [PK_answers] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[questions] WITH NOCHECK ADD 
	CONSTRAINT [PK_questions] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO
