April 1, 2009 at 5:24 am
Hi All
SQL Server 2005
Firstly I need to let you all know that I have only been doing sql server for a few weeks, and today took over all responsibility.
I have been asked to run a script on a database and am seeing the following errors.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblMembershipOrders" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblMembershipOrders" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblTpsSites" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblVisaTask" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblVisaTask" because it does not exist or you do not have permissions.
Msg 3726, Level 16, State 1, Line 3
Could not drop object 'dbo.tblMemberMain' because it is referenced by a FOREIGN KEY constraint.
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'tblMemberMain' in the database.
The thing is, I have made sure I'm the dbowner and have even tried to run it as the sa user, but still I see the errors. I can see that the tables do exist. This is on a live db too, so I'm pulling my hair out.
Any ideas?
Regards
Farren
April 1, 2009 at 5:44 am
What are you trying to do here? I mean are you dropping any of the tables?
April 1, 2009 at 5:54 am
Ah, good point. Ok, might be overkill, but the script looks as follows 🙂
/****** Object: ForeignKey [FK_tblCurrentUsers_tblMemberMain] Script Date: 03/19/2009 11:30:02 ******/
ALTER TABLE [dbo].[tblCurrentUsers] DROP CONSTRAINT [FK_tblCurrentUsers_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMemberExt_tblMemberMain] Script Date: 03/19/2009 11:31:39 ******/
ALTER TABLE [dbo].[tblMemberExt] DROP CONSTRAINT [FK_tblMemberExt_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMembershipOrders_tblCardTypes] Script Date: 03/19/2009 11:32:34 ******/
ALTER TABLE [dbo].[tblMembershipOrders] DROP CONSTRAINT [FK_tblMembershipOrders_tblCardTypes]
GO
/****** Object: ForeignKey [FK_tblMembershipOrders_tblMembershipTypes] Script Date: 03/19/2009 11:32:34 ******/
ALTER TABLE [dbo].[tblMembershipOrders] DROP CONSTRAINT [FK_tblMembershipOrders_tblMembershipTypes]
GO
/****** Object: ForeignKey [FK_tblMemberVisa_tblMemberMain] Script Date: 03/19/2009 11:32:47 ******/
ALTER TABLE [dbo].[tblMemberVisa] DROP CONSTRAINT [FK_tblMemberVisa_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMemberVisa_tblVisa] Script Date: 03/19/2009 11:32:48 ******/
ALTER TABLE [dbo].[tblMemberVisa] DROP CONSTRAINT [FK_tblMemberVisa_tblVisa]
GO
/****** Object: ForeignKey [FK_tblTpsSites_tblMemberMain] Script Date: 03/19/2009 11:33:42 ******/
ALTER TABLE [dbo].[tblTpsSites] DROP CONSTRAINT [FK_tblTpsSites_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblVisa_tblSite] Script Date: 03/19/2009 11:33:53 ******/
ALTER TABLE [dbo].[tblVisa] DROP CONSTRAINT [FK_tblVisa_tblSite]
GO
/****** Object: ForeignKey [FK_tblVisa_tblVisaGroup] Script Date: 03/19/2009 11:33:53 ******/
ALTER TABLE [dbo].[tblVisa] DROP CONSTRAINT [FK_tblVisa_tblVisaGroup]
GO
/****** Object: ForeignKey [FK_tblVisaTask_tblTask] Script Date: 03/19/2009 11:34:03 ******/
ALTER TABLE [dbo].[tblVisaTask] DROP CONSTRAINT [FK_tblVisaTask_tblTask]
GO
/****** Object: ForeignKey [FK_tblVisaTask_tblVisa] Script Date: 03/19/2009 11:34:03 ******/
ALTER TABLE [dbo].[tblVisaTask] DROP CONSTRAINT [FK_tblVisaTask_tblVisa]
GO
/****** Object: Table [dbo].[tblBlogSite] Script Date: 03/19/2009 11:29:08 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblBlogSite]') AND type in (N'U'))
DROP TABLE [dbo].[tblBlogSite]
GO
/****** Object: Table [dbo].[tblComments] Script Date: 03/19/2009 11:29:36 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblComments]') AND type in (N'U'))
DROP TABLE [dbo].[tblComments]
GO
/****** Object: Table [dbo].[tblMemberExt] Script Date: 03/19/2009 11:31:38 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMemberExt]') AND type in (N'U'))
DROP TABLE [dbo].[tblMemberExt]
GO
/****** Object: Table [dbo].[tblMemberMain] Script Date: 03/19/2009 11:31:48 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMemberMain]') AND type in (N'U'))
DROP TABLE [dbo].[tblMemberMain]
GO
/****** Object: Table [dbo].[tblPosts] Script Date: 03/19/2009 11:33:06 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblPosts]') AND type in (N'U'))
DROP TABLE [dbo].[tblPosts]
GO
/****** Object: Table [dbo].[tblPostCategory] Script Date: 03/19/2009 11:32:53 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblPostCategory]') AND type in (N'U'))
DROP TABLE [dbo].[tblPostCategory]
GO
/****** Object: Table [dbo].[tblSiteCategory] Script Date: 03/19/2009 11:33:29 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblSiteCategory]') AND type in (N'U'))
DROP TABLE [dbo].[tblSiteCategory]
GO
/****** Object: Table [dbo].[tblPostTags] Script Date: 03/19/2009 11:33:11 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblPostTags]') AND type in (N'U'))
DROP TABLE [dbo].[tblPostTags]
GO
/****** Object: Table [dbo].[tblTags] Script Date: 03/19/2009 11:33:34 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblTags]') AND type in (N'U'))
DROP TABLE [dbo].[tblTags]
GO
/****** Object: Table [dbo].[tblRSSFeed] Script Date: 03/19/2009 11:33:19 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblRSSFeed]') AND type in (N'U'))
DROP TABLE [dbo].[tblRSSFeed]
GO
/****** Object: Table [dbo].[tblCurrentUsers] Script Date: 03/19/2009 11:30:01 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblCurrentUsers]') AND type in (N'U'))
DROP TABLE [dbo].[tblCurrentUsers]
GO
/****** Object: Table [dbo].[tblVisaTask] Script Date: 03/19/2009 11:34:02 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblVisaTask]') AND type in (N'U'))
DROP TABLE [dbo].[tblVisaTask]
GO
/****** Object: Table [dbo].[tblCountry] Script Date: 03/19/2009 11:29:52 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblCountry]') AND type in (N'U'))
DROP TABLE [dbo].[tblCountry]
GO
/****** Object: Table [dbo].[tblMembershipTypes] Script Date: 03/19/2009 11:32:37 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMembershipTypes]') AND type in (N'U'))
DROP TABLE [dbo].[tblMembershipTypes]
GO
/****** Object: Table [dbo].[tblCardTypes] Script Date: 03/19/2009 11:29:14 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblCardTypes]') AND type in (N'U'))
DROP TABLE [dbo].[tblCardTypes]
GO
/****** Object: Table [dbo].[tblTpsSites] Script Date: 03/19/2009 11:33:41 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblTpsSites]') AND type in (N'U'))
DROP TABLE [dbo].[tblTpsSites]
GO
/****** Object: Table [dbo].[tblTask] Script Date: 03/19/2009 11:33:38 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblTask]') AND type in (N'U'))
DROP TABLE [dbo].[tblTask]
GO
/****** Object: Table [dbo].[tblConferenceEvents] Script Date: 03/19/2009 11:29:48 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblConferenceEvents]') AND type in (N'U'))
DROP TABLE [dbo].[tblConferenceEvents]
GO
/****** Object: Table [dbo].[tblMembershipOrders] Script Date: 03/19/2009 11:32:33 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMembershipOrders]') AND type in (N'U'))
DROP TABLE [dbo].[tblMembershipOrders]
GO
/****** Object: Table [dbo].[tblEclipseCopy] Script Date: 03/19/2009 11:30:27 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblEclipseCopy]') AND type in (N'U'))
DROP TABLE [dbo].[tblEclipseCopy]
GO
/****** Object: Table [dbo].[tblEclipseMembers] Script Date: 03/19/2009 11:30:51 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblEclipseMembers]') AND type in (N'U'))
DROP TABLE [dbo].[tblEclipseMembers]
GO
/****** Object: Table [dbo].[tblEvents] Script Date: 03/19/2009 11:31:02 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblEvents]') AND type in (N'U'))
DROP TABLE [dbo].[tblEvents]
GO
/****** Object: Table [dbo].[tblCategories] Script Date: 03/19/2009 11:29:22 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblCategories]') AND type in (N'U'))
DROP TABLE [dbo].[tblCategories]
GO
/****** Object: Table [dbo].[tblSite] Script Date: 03/19/2009 11:33:25 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblSite]') AND type in (N'U'))
DROP TABLE [dbo].[tblSite]
GO
/****** Object: Table [dbo].[tblVisaGroup] Script Date: 03/19/2009 11:34:00 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblVisaGroup]') AND type in (N'U'))
DROP TABLE [dbo].[tblVisaGroup]
GO
/****** Object: Table [dbo].[tbl_sys_ref] Script Date: 03/19/2009 11:28:57 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tbl_sys_ref]') AND type in (N'U'))
DROP TABLE [dbo].[tbl_sys_ref]
GO
/****** Object: Table [dbo].[tblMemberVisa] Script Date: 03/19/2009 11:32:47 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMemberVisa]') AND type in (N'U'))
DROP TABLE [dbo].[tblMemberVisa]
GO
/****** Object: Table [dbo].[tblVisa] Script Date: 03/19/2009 11:33:52 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblVisa]') AND type in (N'U'))
DROP TABLE [dbo].[tblVisa]
GO
/****** Object: Table [dbo].[tblPosts] Script Date: 03/19/2009 11:33:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblPosts](
[PostID] [int] IDENTITY(1,1) NOT NULL,
[MemberMainID] [int] NOT NULL,
[PostTitle] [nvarchar](255) NULL,
[Slug] [nvarchar](255) NULL,
[PostDesc] [nvarchar](255) NULL,
[PostContent] [ntext] NULL,
[IsCommentEnabled] [bit] NOT NULL CONSTRAINT [DF_tblPosts_IsCommentEnabled] DEFAULT ((0)),
[IsPublished] [bit] NOT NULL CONSTRAINT [DF_tblPosts_IsPublished] DEFAULT ((0)),
[GoLiveDate] [datetime] NULL,
[Source] [int] NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblPosts_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
[Modified] [datetime] NOT NULL CONSTRAINT [DF_tblPosts_Modified] DEFAULT (getdate()),
[ModifiedBy] [int] NOT NULL,
CONSTRAINT [PK_tblPosts] PRIMARY KEY CLUSTERED
(
[PostID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblPostTags] Script Date: 03/19/2009 11:33:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblPostTags](
[PostTagID] [int] IDENTITY(1,1) NOT NULL,
[PostID] [int] NOT NULL,
[TagID] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblPostTags_Created] DEFAULT (getdate()),
[CreatedBy] [int] NULL,
CONSTRAINT [PK_tblPostTags] PRIMARY KEY CLUSTERED
(
[PostTagID] 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
/****** Object: Table [dbo].[tblRSSFeed] Script Date: 03/19/2009 11:33:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblRSSFeed](
[RSSID] [int] IDENTITY(1,1) NOT NULL,
[RSSURL] [nvarchar](255) NOT NULL,
[Status] [bit] NOT NULL CONSTRAINT [DF_tblRSSFeed_Status] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblRSSFeed_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
[Modified] [datetime] NOT NULL CONSTRAINT [DF_tblRSSFeed_Modified] DEFAULT (getdate()),
[ModifiedBy] [int] NOT NULL,
CONSTRAINT [PK_tblRSSFeed] PRIMARY KEY CLUSTERED
(
[RSSID] 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
/****** Object: Table [dbo].[tblSiteCategory] Script Date: 03/19/2009 11:33:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblSiteCategory](
[SiteID] [int] NOT NULL,
[CategoryID] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblSiteCategory_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
CONSTRAINT [PK_tblSiteCategory] PRIMARY KEY CLUSTERED
(
[SiteID] ASC,
[CategoryID] 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
/****** Object: Table [dbo].[tblTags] Script Date: 03/19/2009 11:33:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblTags](
[TagID] [int] IDENTITY(1,1) NOT NULL,
[Tag] [nvarchar](255) NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblTags_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
CONSTRAINT [PK_tblTags] PRIMARY KEY CLUSTERED
(
[TagID] 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
/****** Object: Table [dbo].[tblMemberMain] Script Date: 03/19/2009 11:31:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMemberMain](
[MemberMainID] [int] IDENTITY(1,1) NOT NULL,
[Username] [nvarchar](160) NOT NULL,
[Email] [nvarchar](250) NOT NULL,
[Password] [nvarchar](250) NOT NULL,
[CreatedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberMain_CreatedBy] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblMemberMain_Created] DEFAULT (getdate()),
[LastEditedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberMain_LastEditedBy] DEFAULT ((0)),
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblMemberMain_LastEdited] DEFAULT (getdate()),
CONSTRAINT [PK_tblMemberMain] PRIMARY KEY CLUSTERED
(
[MemberMainID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblSite] Script Date: 03/19/2009 11:33:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblSite](
[SiteID] [int] IDENTITY(1,1) NOT NULL,
[SiteName] [nvarchar](160) NOT NULL,
[CreatedBy] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblSite_Created] DEFAULT (getdate()),
[EditedBy] [int] NOT NULL,
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblSite_LastEdited] DEFAULT (getdate()),
CONSTRAINT [PK_tblSite] PRIMARY KEY CLUSTERED
(
[SiteID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblTask] Script Date: 03/19/2009 11:33:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblTask](
[TaskID] [int] IDENTITY(1,1) NOT NULL,
[TaskName] [nvarchar](255) NOT NULL,
[TaskDescription] [nvarchar](255) NULL,
[DefaultTask] [bit] NOT NULL CONSTRAINT [DF_tblTask_DefaultTask] DEFAULT ((0)),
CONSTRAINT [PK_tblTask] PRIMARY KEY CLUSTERED
(
[TaskID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblVisaGroup] Script Date: 03/19/2009 11:34:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblVisaGroup](
[VisaGroupID] [int] IDENTITY(1,1) NOT NULL,
[VisaGroupName] [nvarchar](50) NOT NULL,
[CreatedBy] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblVisaGroup_Created] DEFAULT (getdate()),
[LastEditedBy] [int] NOT NULL,
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblVisaGroup_LastEdited] DEFAULT (getdate()),
CONSTRAINT [PK_tblVisaGroup] PRIMARY KEY CLUSTERED
(
[VisaGroupID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblCountry] Script Date: 03/19/2009 11:29:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblCountry](
[CountryID] [int] NOT NULL,
[CountryName] [nvarchar](510) NOT NULL,
[Code] [nchar](20) NULL,
[Created] [datetime] NOT NULL,
CONSTRAINT [PK_tblCountry] PRIMARY KEY CLUSTERED
(
[CountryID] 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
/****** Object: Table [dbo].[tblMembershipTypes] Script Date: 03/19/2009 11:32:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMembershipTypes](
[MembershipTypeID] [int] NOT NULL,
[Description] [nvarchar](510) NOT NULL,
CONSTRAINT [PK_tblMembershipTypes] PRIMARY KEY CLUSTERED
(
[MembershipTypeID] 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
/****** Object: Table [dbo].[tblCardTypes] Script Date: 03/19/2009 11:29:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblCardTypes](
[CardTypeID] [int] NOT NULL,
[CardTypeDescription] [nvarchar](510) NOT NULL,
CONSTRAINT [PK_tblCardTypes] PRIMARY KEY CLUSTERED
(
[CardTypeID] 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
/****** Object: Table [dbo].[tblConferenceEvents] Script Date: 03/19/2009 11:29:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblConferenceEvents](
[ConferenceId] [int] IDENTITY(1,1) NOT NULL,
[ConferenceTitle] [nvarchar](255) NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[Venue] [nvarchar](1000) NULL,
[Details] [ntext] NULL,
[IsLive] [bit] NOT NULL CONSTRAINT [DF_tblConferenceEvents_IsLive] DEFAULT ((0)),
[IsDeleted] [bit] NOT NULL CONSTRAINT [DF_tblConferenceEvents_IsDeleted] DEFAULT ((0)),
[ConferenceType] [int] NOT NULL CONSTRAINT [DF_Table_1_EventType] DEFAULT ((1)),
[CreatedBy] [int] NOT NULL,
[Created] [datetime] NOT NULL,
[LastEditedBy] [int] NULL,
[LastEdited] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique identifier of the row' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'ConferenceId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Title' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'ConferenceTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event start date' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'StartDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event end date' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'EndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Venue' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'Venue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Details' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'Details'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Is event live or not' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'IsLive'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Marked for deletion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'IsDeleted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1-PESGB, 2-forthcomming, 3-Others' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'ConferenceType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Who created record' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'CreatedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'When was record created' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'Created'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Who last edited' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'LastEditedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'When last edited' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblConferenceEvents', @level2type=N'COLUMN',@level2name=N'LastEdited'
GO
/****** Object: Table [dbo].[tblEclipseMembers] Script Date: 03/19/2009 11:30:51 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tblEclipseMembers](
[custno] [nvarchar](20) NOT NULL,
[title] [varchar](32) NULL,
[lastname] [nvarchar](128) NULL,
[firstname] [nvarchar](128) NULL,
[jobposition] [varchar](64) NULL,
[department] [nvarchar](128) NULL,
[establishment] [nvarchar](128) NULL,
[add1] [varchar](128) NULL,
[add2] [varchar](128) NULL,
[add3] [varchar](128) NULL,
[add4] [varchar](128) NULL,
[add5] [varchar](128) NULL,
[postcode] [varchar](64) NULL,
[country] [varchar](128) NULL,
[varchar](64) NULL,
[fax] [varchar](64) NULL,
[varchar](255) NULL,
[paymentstatus] [varchar](128) NULL,
[ordernumber] [varchar](128) NULL,
[subnumber] [varchar](128) NULL,
[sourcecode] [varchar](128) NULL,
[quantity] [varchar](128) NULL,
[ordercode] [varchar](128) NULL,
[subsdefid] [varchar](128) NULL,
[sys_id] [int] IDENTITY(1,1) NOT NULL,
[eclipse_customer_no] [varchar](20) NULL,
[memDeal] [varchar](20) NULL,
[payratesubset] [varchar](20) NULL,
[comptype] [varchar](20) NULL,
[paymentrate] [varchar](1) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tblCategories] Script Date: 03/19/2009 11:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblCategories](
[CategoryID] [int] IDENTITY(1,1) NOT NULL,
[Category] [nvarchar](255) NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblCategories_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblCategories_LastEdited] DEFAULT (getdate()),
[EditedBy] [int] NOT NULL,
CONSTRAINT [PK_tblCategories] PRIMARY KEY CLUSTERED
(
[CategoryID] 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
/****** Object: Table [dbo].[tblEclipseCopy] Script Date: 03/19/2009 11:30:27 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tblEclipseCopy](
[customer_id] [nvarchar](20) NOT NULL,
[salutation] [varchar](32) NULL,
[fname] [nvarchar](128) NULL,
[lname] [nvarchar](128) NULL,
[title] [nvarchar](64) NULL,
[department] [nvarchar](128) NULL,
[company] [nvarchar](128) NULL,
[address1] [varchar](128) NULL,
[address2] [varchar](128) NULL,
[address3] [varchar](128) NULL,
[county] [varchar](64) NULL,
[city] [varchar](128) NULL,
[zip] [varchar](64) NULL,
[state] [varchar](128) NOT NULL,
[phone] [varchar](50) NULL,
[faxnbr] [varchar](50) NULL,
[varchar](255) NULL,
[renewal_category] [smallint] NULL,
[orderhdr_id] [nvarchar](20) NULL,
[subscrip_id] [nvarchar](20) NOT NULL,
[source_code] [varchar](15) NULL,
[order_qty] [int] NULL,
[order_code] [varchar](15) NULL,
[subscription_def] [varchar](15) NULL,
[start_date] [datetime] NULL,
[expire_date] [datetime] NULL,
[eclipse_customer_no] [varchar](20) NULL,
[memDeal] [varchar](20) NULL,
[payratesubset] [varchar](20) NULL,
[comptype] [varchar](20) NULL,
[paymentrate] [varchar](1) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tblComments] Script Date: 03/19/2009 11:29:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblComments](
[CommentID] [int] IDENTITY(1,1) NOT NULL,
[PostID] [int] NOT NULL,
[MemberMainID] [int] NULL,
[ClientIP] [nvarchar](15) NULL,
[Comments] [ntext] NULL,
[IsApproved] [bit] NOT NULL CONSTRAINT [DF_tblComments_IsApproved] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblComments_Created] DEFAULT (getdate()),
[CreatedBy] [int] NULL,
[Modified] [datetime] NOT NULL CONSTRAINT [DF_tblComments_Modified] DEFAULT (getdate()),
[ModifiedBy] [int] NULL,
CONSTRAINT [PK_tblComments] PRIMARY KEY CLUSTERED
(
[CommentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblPostCategory] Script Date: 03/19/2009 11:32:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblPostCategory](
[PostID] [int] NOT NULL,
[CategoryID] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblPostCategory_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
CONSTRAINT [PK_tblPostCategory] PRIMARY KEY CLUSTERED
(
[PostID] ASC,
[CategoryID] 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
/****** Object: Table [dbo].[tblBlogSite] Script Date: 03/19/2009 11:29:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblBlogSite](
[SiteID] [int] IDENTITY(1,1) NOT NULL,
[SiteDesc] [nvarchar](255) NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblBlogSite_Created] DEFAULT (getdate()),
[CreatedBy] [int] NOT NULL,
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblBlogSite_LastEdited] DEFAULT (getdate()),
[EditedBy] [int] NOT NULL,
CONSTRAINT [PK_tblBlogSite] PRIMARY KEY CLUSTERED
(
[SiteID] 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
/****** Object: Table [dbo].[tbl_sys_ref] Script Date: 03/19/2009 11:28:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_sys_ref](
[sys_id] [int] IDENTITY(1,1) NOT NULL,
[section] [nvarchar](8) NULL,
[refval] [int] NOT NULL,
[datecreated] [datetime] NOT NULL CONSTRAINT [DF_tbl_sys_ref_datecreated] DEFAULT (getdate()),
[datelastedited] [datetime] NOT NULL CONSTRAINT [DF_tbl_sys_ref_datelastedited] DEFAULT (getdate()),
CONSTRAINT [PK_tbl_sys_ref] PRIMARY KEY CLUSTERED
(
[sys_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblEvents] Script Date: 03/19/2009 11:31:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblEvents](
[EventId] [int] IDENTITY(1,1) NOT NULL,
[EventTitle] [nvarchar](255) NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NULL,
[Venue] [nvarchar](1000) NULL,
[Details] [ntext] NULL,
[IsLive] [bit] NOT NULL CONSTRAINT [DF_tblEvents_IsLive] DEFAULT ((0)),
[IsDeleted] [bit] NOT NULL CONSTRAINT [DF_tblEvents_IsDeleted] DEFAULT ((0)),
[EventType] [int] NOT NULL CONSTRAINT [DF_tblEvents_EventType] DEFAULT ((1)),
[CreatedBy] [int] NOT NULL,
[Created] [datetime] NOT NULL,
[LastEditedBy] [int] NULL,
[LastEdited] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique identifier of the row' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'EventId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Title' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'EventTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event start date' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'StartDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event end date' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'EndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Venue' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'Venue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Event Details' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'Details'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Is event live or not' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'IsLive'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Marked for deletion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'IsDeleted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1-events, 2-other events' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'EventType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Who created record' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'CreatedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'When was record created' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'Created'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Who last edited' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'LastEditedBy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'When last edited' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tblEvents', @level2type=N'COLUMN',@level2name=N'LastEdited'
GO
/****** Object: Table [dbo].[tblMemberExt] Script Date: 03/19/2009 11:31:38 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMemberExt](
[MemberMainID] [int] NOT NULL,
[DisplayName] [nvarchar](255) NULL,
[IsDisabled] [bit] NOT NULL CONSTRAINT [DF_tblMemberExt_IsDisabled] DEFAULT ((0)),
[CreatedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberExt_CreatedBy] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblMemberExt_Created] DEFAULT (getdate()),
[LastEditedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberExt_LastEditedBy] DEFAULT ((0)),
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblMemberExt_LastEdited] DEFAULT (getdate()),
[CustNo] [nvarchar](50) NULL,
[WebRef] [nvarchar](50) NULL,
[Title] [nvarchar](160) NULL,
[FirstName] [nvarchar](160) NULL,
[Surname] [nvarchar](160) NULL,
[PasswordReminder] [nvarchar](500) NULL,
[Address] [nvarchar](255) NULL,
[Town] [nvarchar](255) NULL,
[County] [nvarchar](255) NULL,
[PostalCode] [nvarchar](20) NULL,
[Country] [int] NULL,
[Telephone] [nvarchar](50) NULL,
[Fax] [nvarchar](50) NULL,
[Email] [nvarchar](510) NULL,
[DeliveryAddress] [nvarchar](255) NULL,
[DeliveryCity] [nvarchar](255) NULL,
[DeliveryCounty] [nvarchar](255) NULL,
[DeliveryPostalCode] [nvarchar](20) NULL,
[DeliveryCountry] [int] NULL,
[AcademicQualifications] [nvarchar](255) NULL,
[CurrentTitle] [nvarchar](255) NULL,
[Institution] [nvarchar](255) NULL,
[Department] [nvarchar](128) NULL,
[JobPosition] [nvarchar](128) NULL,
[DateAppointment] [datetime] NULL,
[ProposerName] [nvarchar](255) NULL,
[ProposerEmail] [nvarchar](255) NULL,
[BiographicalDetails] [nvarchar](max) NULL,
[BlogAddress] [nvarchar](255) NULL,
[ExternalProfile] [nvarchar](255) NULL,
[LatestPublications] [nvarchar](255) NULL,
[MainLocation] [nvarchar](520) NULL,
[SpecialistSubject] [nvarchar](520) NULL,
[AvailabilityInUKStartDate] [datetime] NULL,
[AvailabilityInUKEndDate] [datetime] NULL,
[IsDeleted] [bit] NULL,
[IsDisplayedInDirectory] [bit] NULL CONSTRAINT [DF_tblMemberExt_IsDisplayedInDirectory] DEFAULT ((0)),
[Emailed] [bit] NOT NULL CONSTRAINT [DF_tblMemberExt_Emailed] DEFAULT ((0)),
[Optin] [bit] NULL CONSTRAINT [DF_tblMemberExt_Optin_1] DEFAULT ((0)),
CONSTRAINT [PK_tblMemberExt] PRIMARY KEY CLUSTERED
(
[MemberMainID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblCurrentUsers] Script Date: 03/19/2009 11:30:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblCurrentUsers](
[SessionID] [uniqueidentifier] NOT NULL,
[MemberMainID] [int] NOT NULL,
[LoggedOn] [datetime] NOT NULL,
[LastActivity] [nvarchar](160) NOT NULL,
[LastActivityDate] [datetime] NOT NULL,
[CreatedBy] [int] NOT NULL CONSTRAINT [DF_tblCurrentUsers_CreatedBy] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblCurrentUsers_Created] DEFAULT (getdate()),
[LastEditedBy] [int] NOT NULL CONSTRAINT [DF_tblCurrentUsers_LastEditedBy] DEFAULT ((0)),
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblCurrentUsers_LastEdited] DEFAULT (getdate()),
CONSTRAINT [PK_tblCurrentUsers] PRIMARY KEY CLUSTERED
(
[SessionID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblTpsSites] Script Date: 03/19/2009 11:33:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblTpsSites](
[MemberMainID] [int] NOT NULL,
[ClientIP] [nvarchar](250) NOT NULL,
[SID] [nvarchar](250) NULL,
CONSTRAINT [PK_tblTpsSites] PRIMARY KEY CLUSTERED
(
[MemberMainID] ASC,
[ClientIP] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblMemberVisa] Script Date: 03/19/2009 11:32:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMemberVisa](
[MemberMainID] [int] NOT NULL,
[VisaID] [int] NOT NULL,
[VisaStart] [datetime] NOT NULL CONSTRAINT [DF_tblMemberVisa_VisaStart] DEFAULT (getdate()),
[VisaExpire] [datetime] NULL,
[CreatedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberVisa_CreatedBy] DEFAULT ((0)),
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblMemberVisa_Created] DEFAULT (getdate()),
[LastEditedBy] [nvarchar](160) NOT NULL CONSTRAINT [DF_tblMemberVisa_LastEditedBy] DEFAULT ((0)),
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblMemberVisa_LastEdited] DEFAULT (getdate())
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblVisa] Script Date: 03/19/2009 11:33:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblVisa](
[VisaID] [int] NOT NULL,
[VisaGroupID] [int] NOT NULL,
[SiteID] [int] NOT NULL,
[VisaName] [nvarchar](255) NOT NULL,
[DefaultVisaStart] [datetime] NOT NULL,
[DefaultVisaExpire] [datetime] NULL,
[DefaultVisa] [bit] NOT NULL CONSTRAINT [DF_tblVisa_DefaultVisa] DEFAULT ((0)),
[CreatedBy] [int] NOT NULL,
[Created] [datetime] NOT NULL CONSTRAINT [DF_tblVisa_Created] DEFAULT (getdate()),
[LastEditedBy] [int] NOT NULL,
[LastEdited] [datetime] NOT NULL CONSTRAINT [DF_tblVisa_LastEdited] DEFAULT (getdate()),
CONSTRAINT [PK_tblVisa] PRIMARY KEY CLUSTERED
(
[VisaID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblVisaTask] Script Date: 03/19/2009 11:34:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblVisaTask](
[VisaID] [int] NOT NULL,
[TaskID] [int] NOT NULL,
CONSTRAINT [PK_tblVisaTask] PRIMARY KEY CLUSTERED
(
[VisaID] ASC,
[TaskID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[tblMembershipOrders] Script Date: 03/19/2009 11:32:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tblMembershipOrders](
[MembershipOrderID] [int] IDENTITY(1,1) NOT NULL,
[MemberMainID] [int] NULL,
[MembershipOrderType] [int] NOT NULL,
[RFAProcessType] [bit] NULL,
[RefNumber] [varchar](510) NULL,
[MembershipStartDate] [datetime] NULL,
[MembershipEndDate] [datetime] NULL,
[MembershipTypeID] [int] NOT NULL,
[Title] [nvarchar](320) NOT NULL,
[FirstName] [nvarchar](510) NOT NULL,
[Surname] [nvarchar](510) NOT NULL,
[Address] [nvarchar](510) NOT NULL,
[Town] [nvarchar](510) NOT NULL,
[County] [nvarchar](510) NULL,
[PostalCode] [nvarchar](40) NOT NULL,
[CountryID] [int] NOT NULL,
[Telephone] [nvarchar](50) NOT NULL,
[Fax] [nvarchar](50) NULL,
[Email] [nvarchar](50) NOT NULL,
[DeliveryAddress] [nvarchar](510) NULL,
[DeliveryTown] [nvarchar](510) NULL,
[DeliveryCounty] [nvarchar](510) NULL,
[DeliveryPostalCode] [nvarchar](40) NULL,
[DeliveryCountryID] [int] NULL,
[AcademicQualifications] [nvarchar](510) NULL,
[CurrentTitle] [nvarchar](510) NULL,
[Institution] [nvarchar](510) NULL,
[DateAppointment] [datetime] NULL,
[ProposerName] [nvarchar](510) NULL,
[ProposerEmail] [nvarchar](510) NULL,
[CardTypeID] [int] NULL,
[CardNumber] [varchar](255) NULL,
[ExpiryMonth] [int] NULL,
[ExpiryYear] [int] NULL,
[CardHolderName] [nvarchar](510) NULL,
[BillingAddress] [nvarchar](510) NULL,
[BillingTown] [nvarchar](510) NULL,
[BillingCounty] [nvarchar](510) NULL,
[BillingCountryID] [int] NULL,
[BillingPostalCode] [varchar](100) NULL,
[IsDeleted] [bit] NOT NULL CONSTRAINT [DF_tblMembershipOrders_IsDeleted] DEFAULT ((0)),
[IsDisplayedInDirectory] [bit] NOT NULL CONSTRAINT [DF_tblMembershipOrders_IsDisplayedInDirectory] DEFAULT ((0)),
[BiographicalDetails] [nvarchar](510) NULL,
[BlogAddress] [nvarchar](510) NULL,
[ExternalProfile] [nvarchar](510) NULL,
[LatestPublications] [nvarchar](510) NULL,
[LocationInUK] [nvarchar](510) NULL,
[SpecialistSubject] [nvarchar](510) NULL,
[AvailabilityStart] [datetime] NULL,
[AvailabilityEnd] [datetime] NULL,
[CreatedBy] [int] NULL,
[Created] [datetime] NULL,
[Processed] [bit] NULL,
[ProcessedDate] [datetime] NULL,
[ProcessedBy] [int] NULL,
CONSTRAINT [PK_tblMembershipOrders] PRIMARY KEY CLUSTERED
(
[MembershipOrderID] 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
/****** Object: ForeignKey [FK_tblCurrentUsers_tblMemberMain] Script Date: 03/19/2009 11:30:02 ******/
ALTER TABLE [dbo].[tblCurrentUsers] WITH CHECK ADD CONSTRAINT [FK_tblCurrentUsers_tblMemberMain] FOREIGN KEY([MemberMainID])
REFERENCES [dbo].[tblMemberMain] ([MemberMainID])
GO
ALTER TABLE [dbo].[tblCurrentUsers] CHECK CONSTRAINT [FK_tblCurrentUsers_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMemberExt_tblMemberMain] Script Date: 03/19/2009 11:31:39 ******/
ALTER TABLE [dbo].[tblMemberExt] WITH NOCHECK ADD CONSTRAINT [FK_tblMemberExt_tblMemberMain] FOREIGN KEY([MemberMainID])
REFERENCES [dbo].[tblMemberMain] ([MemberMainID])
GO
ALTER TABLE [dbo].[tblMemberExt] NOCHECK CONSTRAINT [FK_tblMemberExt_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMembershipOrders_tblCardTypes] Script Date: 03/19/2009 11:32:34 ******/
ALTER TABLE [dbo].[tblMembershipOrders] WITH CHECK ADD CONSTRAINT [FK_tblMembershipOrders_tblCardTypes] FOREIGN KEY([CardTypeID])
REFERENCES [dbo].[tblCardTypes] ([CardTypeID])
GO
ALTER TABLE [dbo].[tblMembershipOrders] CHECK CONSTRAINT [FK_tblMembershipOrders_tblCardTypes]
GO
/****** Object: ForeignKey [FK_tblMembershipOrders_tblMembershipTypes] Script Date: 03/19/2009 11:32:34 ******/
ALTER TABLE [dbo].[tblMembershipOrders] WITH CHECK ADD CONSTRAINT [FK_tblMembershipOrders_tblMembershipTypes] FOREIGN KEY([MembershipOrderType])
REFERENCES [dbo].[tblMembershipTypes] ([MembershipTypeID])
GO
ALTER TABLE [dbo].[tblMembershipOrders] CHECK CONSTRAINT [FK_tblMembershipOrders_tblMembershipTypes]
GO
/****** Object: ForeignKey [FK_tblMemberVisa_tblMemberMain] Script Date: 03/19/2009 11:32:47 ******/
ALTER TABLE [dbo].[tblMemberVisa] WITH CHECK ADD CONSTRAINT [FK_tblMemberVisa_tblMemberMain] FOREIGN KEY([MemberMainID])
REFERENCES [dbo].[tblMemberMain] ([MemberMainID])
GO
ALTER TABLE [dbo].[tblMemberVisa] CHECK CONSTRAINT [FK_tblMemberVisa_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblMemberVisa_tblVisa] Script Date: 03/19/2009 11:32:48 ******/
ALTER TABLE [dbo].[tblMemberVisa] WITH CHECK ADD CONSTRAINT [FK_tblMemberVisa_tblVisa] FOREIGN KEY([VisaID])
REFERENCES [dbo].[tblVisa] ([VisaID])
GO
ALTER TABLE [dbo].[tblMemberVisa] CHECK CONSTRAINT [FK_tblMemberVisa_tblVisa]
GO
/****** Object: ForeignKey [FK_tblTpsSites_tblMemberMain] Script Date: 03/19/2009 11:33:42 ******/
ALTER TABLE [dbo].[tblTpsSites] WITH CHECK ADD CONSTRAINT [FK_tblTpsSites_tblMemberMain] FOREIGN KEY([MemberMainID])
REFERENCES [dbo].[tblMemberMain] ([MemberMainID])
GO
ALTER TABLE [dbo].[tblTpsSites] CHECK CONSTRAINT [FK_tblTpsSites_tblMemberMain]
GO
/****** Object: ForeignKey [FK_tblVisa_tblSite] Script Date: 03/19/2009 11:33:53 ******/
ALTER TABLE [dbo].[tblVisa] WITH CHECK ADD CONSTRAINT [FK_tblVisa_tblSite] FOREIGN KEY([SiteID])
REFERENCES [dbo].[tblSite] ([SiteID])
GO
ALTER TABLE [dbo].[tblVisa] CHECK CONSTRAINT [FK_tblVisa_tblSite]
GO
/****** Object: ForeignKey [FK_tblVisa_tblVisaGroup] Script Date: 03/19/2009 11:33:53 ******/
ALTER TABLE [dbo].[tblVisa] WITH CHECK ADD CONSTRAINT [FK_tblVisa_tblVisaGroup] FOREIGN KEY([VisaGroupID])
REFERENCES [dbo].[tblVisaGroup] ([VisaGroupID])
GO
ALTER TABLE [dbo].[tblVisa] CHECK CONSTRAINT [FK_tblVisa_tblVisaGroup]
GO
/****** Object: ForeignKey [FK_tblVisaTask_tblTask] Script Date: 03/19/2009 11:34:03 ******/
ALTER TABLE [dbo].[tblVisaTask] WITH CHECK ADD CONSTRAINT [FK_tblVisaTask_tblTask] FOREIGN KEY([TaskID])
REFERENCES [dbo].[tblTask] ([TaskID])
GO
ALTER TABLE [dbo].[tblVisaTask] CHECK CONSTRAINT [FK_tblVisaTask_tblTask]
GO
/****** Object: ForeignKey [FK_tblVisaTask_tblVisa] Script Date: 03/19/2009 11:34:03 ******/
ALTER TABLE [dbo].[tblVisaTask] WITH CHECK ADD CONSTRAINT [FK_tblVisaTask_tblVisa] FOREIGN KEY([VisaID])
REFERENCES [dbo].[tblVisa] ([VisaID])
GO
ALTER TABLE [dbo].[tblVisaTask] CHECK CONSTRAINT [FK_tblVisaTask_tblVisa]
GO
ALTER TABLE dbo.tblSectionContent
ADD Introduction NVARCHAR(500) NULL DEFAULT '',
IsDeleted BIT NULL DEFAULT 0,
CreatedBy INT NULL DEFAULT 0,
Created DATETIME NULL DEFAULT GetDate()
April 1, 2009 at 6:40 am
did you accidentally run the script on the master database instead of a specific database? or a different database than the one you needed to?
Lowell
April 1, 2009 at 6:45 am
No, definitely running on the correct Db.
It's does actually have the correct USE statement at the top but I forgot to paste it.
If my user has sysadmin privileges, do I need to specify myself as dbowner for that database? I had assumed not.
April 1, 2009 at 8:28 am
Msg 3726, Level 16, State 1, Line 3
Could not drop object 'dbo.tblMemberMain' because it is referenced by a FOREIGN KEY constraint.
There is a foreign key referenced to this table, so check the dependencies and drop the foreign key before droppping the table. In your script I have not seen you dropping the foregin key for this.
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'tblMemberMain' in the database.
obviously because of the above error.
Cannot find the object "dbo.tblMembershipOrders" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Are you sure that you have this object?
SELECT * FROM sys.objects
WHERE name ='dbo.tblMembershipOrders'
Cannot find the object "dbo.tblTpsSites" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblVisaTask" because it does not exist or you do not have permissions.
Msg 4902, Level 16, State 1, Line 2
Cannot find the object "dbo.tblVisaTask" because it does not exist or you do not have permissions.
Msg 3726, Level 16, State 1, Line 3
Same with these ones? Can you cross check them. In your
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblMembershipOrders]') AND type in (N'U'))
DROP TABLE [dbo].[tblMembershipOrders]
GO
You are trying to drop an object that does not exist. Level 16 message, that's what it means. Can you exclude this and try to create it may be?
If my user has sysadmin privileges, do I need to specify myself as dbowner for that database? I had assumed not.
By default sysdmin is considered to be a dbo.
April 1, 2009 at 8:52 am
Hi all
Thanks for your help with this.
Seeing as it's my first day for real and there are clearly a lot of problems with this I have put it back to the developers to look into.
Many thanks again
Farren
April 1, 2009 at 9:02 am
Wooo...tht's the way to go fire back to the developers :-D, where it came from
April 1, 2009 at 9:19 am
Quite 🙂 I wanted to do my best to solve the issue myself, but seeing as this SQL stuff is now just an addition to my other jobs, I figure I can only do so much 🙂
This forum looks awesome though, and it was nice to get so much feedback.
Thanks again.. until next time 🙂
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply