/* ============================================================
   SCRIPT HEADER (DATABASE STRUCTURE AND DATA)

   DESCRIPTION:  Structure Definition Script for
   Tables:
      codefixerlp_tblPayment, codefixerlp_tblNews, codefixerlp_tblLink
      codefixerlp_tblSchema, codefixerlp_tblReview, codefixerlp_tblRating
      codefixerlp_tblConfig, codefixerlp_tblCategoryRoute, codefixerlp_tblCategory
      codefixerlp_tblEmailTemplate, codefixerlp_tblEmail, codefixerlp_tblCustomPage

   DESCRIPTION:  Data Script for
   Tables:
      codefixerlp_tblPayment, codefixerlp_tblNews, codefixerlp_tblLink
      codefixerlp_tblSchema, codefixerlp_tblReview, codefixerlp_tblRating
      codefixerlp_tblConfig, codefixerlp_tblCategoryRoute, codefixerlp_tblCategory
      codefixerlp_tblEmailTemplate, codefixerlp_tblEmail, codefixerlp_tblCustomPage

   DATABASE:	(local).master
   =============================================================*/

SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_WARNINGS ON
SET NOCOUNT ON
SET XACT_ABORT ON
GO

-- BEGINNING TRANSACTION STRUCTURE
PRINT 'Beginning transaction STRUCTURE'
BEGIN TRANSACTION _STRUCTURE_
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblCategory
Print 'Create Table codefixerlp_tblCategory'
GO
CREATE TABLE [codefixerlp_tblCategory] (
		[fldID]                      int NOT NULL IDENTITY(1, 1),
		[fldIDParent]                int NULL,
		[fldCategoryName]            varchar(50) NULL,
		[fldPageName]                varchar(255) NULL,
		[fldCategoryDescription]     text NULL,
		[fldDateAdded]               smalldatetime NULL,
		[fldActive]                  bit NULL,
		[fldTitle]                   varchar(255) NULL,
		[fldKeywords]                varchar(255) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblCategory to codefixerlp_tblCategory
Print 'Add Primary Key PK_codefixerlp_tblCategory to codefixerlp_tblCategory'
GO
ALTER TABLE [codefixerlp_tblCategory]
	ADD
	CONSTRAINT [PK_codefixerlp_tblCategory]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblCategoryRoute
Print 'Create Table codefixerlp_tblCategoryRoute'
GO
CREATE TABLE [codefixerlp_tblCategoryRoute] (
		[fldID]              int NOT NULL IDENTITY(1, 1),
		[fldIDCat]           int NULL,
		[fldIDCatParent]     int NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblCategoryRoute to codefixerlp_tblCategoryRoute
Print 'Add Primary Key PK_codefixerlp_tblCategoryRoute to codefixerlp_tblCategoryRoute'
GO
ALTER TABLE [codefixerlp_tblCategoryRoute]
	ADD
	CONSTRAINT [PK_codefixerlp_tblCategoryRoute]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblConfig
Print 'Create Table codefixerlp_tblConfig'
GO
CREATE TABLE [codefixerlp_tblConfig] (
		[fldID]                     int NOT NULL IDENTITY(1, 1),
		[fldConfigName]             varchar(255) NULL,
		[fldConfigValue]            text NULL,
		[fldProtected]              bit NULL,
		[fldDataType]               varchar(50) NULL,
		[fldConfigDescription]      text NULL,
		[fldSystem]                 bit NULL,
		[fldRank]                   int NULL,
		[fldOption1Text]            text NULL,
		[fldOption1Value]           text NULL,
		[fldOption2Text]            text NULL,
		[fldOption2Value]           text NULL,
		[fldOption3Text]            text NULL,
		[fldOption3Value]           text NULL,
		[fldOption4Text]            text NULL,
		[fldOption4Value]           text NULL,
		[fldOption5Text]            text NULL,
		[fldOption5Value]           text NULL,
		[fldOption6Text]            text NULL,
		[fldOption6Value]           text NULL,
		[fldOption7Text]            text NULL,
		[fldOption7Value]           text NULL,
		[fldOption8Text]            text NULL,
		[fldOption8Value]           text NULL,
		[fldOption9Text]            text NULL,
		[fldOption9Value]           text NULL,
		[fldOption10Text]           text NULL,
		[fldOption10Value]          text NULL,
		[fldOtherAllowed]           bit NULL,
		[fldConfigFriendlyName]     varchar(255) NULL,
		[fldTextArea]               bit NULL,
		[fldIDType]                 int NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblConfig to codefixerlp_tblConfig
Print 'Add Primary Key PK_codefixerlp_tblConfig to codefixerlp_tblConfig'
GO
ALTER TABLE [codefixerlp_tblConfig]
	ADD
	CONSTRAINT [PK_codefixerlp_tblConfig]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblCustomPage
Print 'Create Table codefixerlp_tblCustomPage'
GO
CREATE TABLE [codefixerlp_tblCustomPage] (
		[fldID]            int NOT NULL IDENTITY(1, 1),
		[fldMenuTitle]     varchar(50) NULL,
		[fldPageName]      varchar(255) NULL,
		[fldBody]          text NULL,
		[fldActive]        bit NULL,
		[fldPosition]      varchar(50) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblCustomPage to codefixerlp_tblCustomPage
Print 'Add Primary Key PK_codefixerlp_tblCustomPage to codefixerlp_tblCustomPage'
GO
ALTER TABLE [codefixerlp_tblCustomPage]
	ADD
	CONSTRAINT [PK_codefixerlp_tblCustomPage]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblEmail
Print 'Create Table codefixerlp_tblEmail'
GO
CREATE TABLE [codefixerlp_tblEmail] (
		[fldID]                    int NOT NULL IDENTITY(1, 1),
		[fldEmailFrom]             varchar(255) NULL,
		[fldEmailTo]               varchar(255) NULL,
		[fldEmailCC]               text NULL,
		[fldEmailBCC]              text NULL,
		[fldEmailSubject]          varchar(255) NULL,
		[fldEmailBody]             text NULL,
		[fldEmailDateAdded]        smalldatetime NULL,
		[fldEmailFormat]           varchar(50) NULL,
		[fldEmailIP]               varchar(50) NULL,
		[fldEmailSessionID]        varchar(50) NULL,
		[fldEmailTicket]           varchar(50) NULL,
		[fldEmailServerName]       varchar(255) NULL,
		[fldEmailComponent]        varchar(50) NULL,
		[fldEmailAuthUsername]     varchar(255) NULL,
		[fldEmailAuthPassword]     varchar(255) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblEmail to codefixerlp_tblEmail
Print 'Add Primary Key PK_codefixerlp_tblEmail to codefixerlp_tblEmail'
GO
ALTER TABLE [codefixerlp_tblEmail]
	ADD
	CONSTRAINT [PK_codefixerlp_tblEmail]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblEmailTemplate
Print 'Create Table codefixerlp_tblEmailTemplate'
GO
CREATE TABLE [codefixerlp_tblEmailTemplate] (
		[fldID]                    int NOT NULL IDENTITY(1, 1),
		[fldTemplateName]          varchar(255) NULL,
		[fldHeader]                text NULL,
		[fldContent]               text NULL,
		[fldFooter]                text NULL,
		[fldDateAdded]             smalldatetime NULL,
		[fldTypeEmailTemplate]     varchar(50) NULL,
		[fldActive]                bit NULL,
		[fldSystem]                bit NULL,
		[fldProtected]             bit NULL,
		[fldSubject]               varchar(255) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblEmailTemplate to codefixerlp_tblEmailTemplate
Print 'Add Primary Key PK_codefixerlp_tblEmailTemplate to codefixerlp_tblEmailTemplate'
GO
ALTER TABLE [codefixerlp_tblEmailTemplate]
	ADD
	CONSTRAINT [PK_codefixerlp_tblEmailTemplate]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblLink
Print 'Create Table codefixerlp_tblLink'
GO
CREATE TABLE [codefixerlp_tblLink] (
		[fldID]                  int NOT NULL IDENTITY(1, 1),
		[fldIDParent]            int NULL,
		[fldActive]              bit NULL,
		[fldFeatured]            bit NULL,
		[fldRating]              float NULL,
		[fldNumberOfRatings]     int NULL,
		[fldLinkName]            varchar(255) NULL,
		[fldURL]                 varchar(255) NULL,
		[fldReciprocalURL]       varchar(255) NULL,
		[fldLinkDescription]     text NULL,
		[fldContactName]         varchar(50) NULL,
		[fldContactEmail]        varchar(50) NULL,
		[fldLinkNotes]           text NULL,
		[fldDateAdded]           smalldatetime NULL,
		[fldApproved]            bit NULL,
		[fldPageName]            varchar(255) NULL,
		[fldIDType]              int NULL,
		[fldPaymentItemName]     varchar(50) NULL,
		[fldImageURL]            varchar(255) NULL,
		[fldAddress]             varchar(50) NULL,
		[fldTown]                varchar(50) NULL,
		[fldCounty]              varchar(50) NULL,
		[fldPostCode]            varchar(50) NULL,
		[fldCountry]             varchar(50) NULL,
		[fldPhone]               varchar(50) NULL,
		[fldURLMap]              varchar(255) NULL,
		[fldCustomContent]       text NULL,
		[fldClickThrough]        int NULL,
		[fldImageURLb]           varchar(255) NULL,
		[fldImageURLc]           varchar(255) NULL,
		[fldHits]                int NULL,
		[fldOtherCategory]       varchar(50) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblLink to codefixerlp_tblLink
Print 'Add Primary Key PK_codefixerlp_tblLink to codefixerlp_tblLink'
GO
ALTER TABLE [codefixerlp_tblLink]
	ADD
	CONSTRAINT [PK_codefixerlp_tblLink]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblNews
Print 'Create Table codefixerlp_tblNews'
GO
CREATE TABLE [codefixerlp_tblNews] (
		[fldID]                  int NOT NULL IDENTITY(1, 1),
		[fldTitle]               varchar(255) NULL,
		[fldBody]                text NULL,
		[fldRating]              float NULL,
		[fldNumberOfRatings]     int NULL,
		[fldActive]              bit NULL,
		[fldDateAdded]           smalldatetime NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblNews to codefixerlp_tblNews
Print 'Add Primary Key PK_codefixerlp_tblNews to codefixerlp_tblNews'
GO
ALTER TABLE [codefixerlp_tblNews]
	ADD
	CONSTRAINT [PK_codefixerlp_tblNews]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblPayment
Print 'Create Table codefixerlp_tblPayment'
GO
CREATE TABLE [codefixerlp_tblPayment] (
		[fldID]                           int NOT NULL IDENTITY(1, 1),
		[fldItemName]                     varchar(255) NULL,
		[fldItemNumber]                   varchar(50) NULL,
		[fldPaymentAmount]                float NULL,
		[fldPaymentCurrency]              varchar(50) NULL,
		[fldReceiverEmail]                varchar(50) NULL,
		[fldPayerEmail]                   varchar(50) NULL,
		[fldInvoice]                      varchar(255) NULL,
		[fldFirstName]                    varchar(50) NULL,
		[fldLastName]                     varchar(50) NULL,
		[fldAddress]                      varchar(50) NULL,
		[fldCity]                         varchar(50) NULL,
		[fldCounty]                       varchar(50) NULL,
		[fldPostCode]                     varchar(50) NULL,
		[fldCountry]                      varchar(50) NULL,
		[fldPhoneA]                       varchar(50) NULL,
		[fldPhoneB]                       varchar(50) NULL,
		[fldShipping]                     float NULL,
		[fldHandling]                     float NULL,
		[fldTax]                          float NULL,
		[fldPaymentStatus]                varchar(50) NULL,
		[fldTransactionID]                varchar(50) NULL,
		[fldTransactionDateTime]          smalldatetime NULL,
		[fldSecurityKey]                  varchar(50) NULL,
		[fldGatewayStatus]                varchar(50) NULL,
		[fldIDType]                       int NULL,
		[fldIDOwner]                      int NULL,
		[fldIDTypeOwner]                  int NULL,
		[fldSessionID]                    varchar(50) NULL,
		[fldIP]                           varchar(50) NULL,
		[fldNotes]                        text NULL,
		[fldRecurringTimePeriod]          varchar(50) NULL,
		[fldRecurringTimePeriodUnit]      int NULL,
		[fldRecurringDateStart]           smalldatetime NULL,
		[fldPaymentStatusDescription]     varchar(255) NULL,
		[fldRecurringDateEnd]             smalldatetime NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblPayment to codefixerlp_tblPayment
Print 'Add Primary Key PK_codefixerlp_tblPayment to codefixerlp_tblPayment'
GO
ALTER TABLE [codefixerlp_tblPayment]
	ADD
	CONSTRAINT [PK_codefixerlp_tblPayment]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblRating
Print 'Create Table codefixerlp_tblRating'
GO
CREATE TABLE [codefixerlp_tblRating] (
		[fldID]            int NOT NULL IDENTITY(1, 1),
		[fldIDLink]        int NULL,
		[fldRating]        float NULL,
		[fldIPAddress]     varchar(50) NULL,
		[fldActive]        bit NULL,
		[fldDateAdded]     smalldatetime NULL,
		[fldIDType]        int NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblRating to codefixerlp_tblRating
Print 'Add Primary Key PK_codefixerlp_tblRating to codefixerlp_tblRating'
GO
ALTER TABLE [codefixerlp_tblRating]
	ADD
	CONSTRAINT [PK_codefixerlp_tblRating]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblReview
Print 'Create Table codefixerlp_tblReview'
GO
CREATE TABLE [codefixerlp_tblReview] (
		[fldID]            int NOT NULL IDENTITY(1, 1),
		[fldIDLink]        int NULL,
		[fldFirstName]     varchar(100) NULL,
		[fldLastName]      varchar(100) NULL,
		[fldBody]          text NULL,
		[fldIPAddress]     varchar(50) NULL,
		[fldActive]        bit NULL,
		[fldDateAdded]     smalldatetime NULL,
		[fldIDType]        int NULL,
		[fldInfo]          varchar(255) NULL
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblReview to codefixerlp_tblReview
Print 'Add Primary Key PK_codefixerlp_tblReview to codefixerlp_tblReview'
GO
ALTER TABLE [codefixerlp_tblReview]
	ADD
	CONSTRAINT [PK_codefixerlp_tblReview]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING OFF
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Create Table codefixerlp_tblSchema
Print 'Create Table codefixerlp_tblSchema'
GO
CREATE TABLE [codefixerlp_tblSchema] (
		[fldID]                 int NOT NULL IDENTITY(1, 1),
		[fldSchemaName]         varchar(50) NULL,
		[fldSchemaClass]        varchar(50) NULL,
		[fldSchemaView]         varchar(255) NULL,
		[fldResultsPerPage]     int NULL,
		[fldFieldsViewable]     varchar(50) NULL,
		[fldTitle]              varchar(50) NULL,
		[fldMessage]            varchar(50) NULL,
		[fldFormID]             varchar(50) NULL,
		[fldFormText]           varchar(50) NULL,
		[fldWidth]              varchar(50) NULL,
		[fldHeight]             varchar(50) NULL,
		[fldFieldID]            varchar(50) NULL,
		[fldFieldText]          varchar(50) NULL,
		[fldSchemaCategory]     varchar(50) NULL
)
ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO
-- Add Primary Key PK_codefixerlp_tblSchema to codefixerlp_tblSchema
Print 'Add Primary Key PK_codefixerlp_tblSchema to codefixerlp_tblSchema'
GO
ALTER TABLE [codefixerlp_tblSchema]
	ADD
	CONSTRAINT [PK_codefixerlp_tblSchema]
	PRIMARY KEY
	([fldID])
	ON [PRIMARY]
GO
IF @@ERROR<>0 OR @@TRANCOUNT=0 BEGIN
	IF @@TRANCOUNT>0
		ROLLBACK
	
	SET NOEXEC ON
END
GO

-- COMMITTING TRANSACTION STRUCTURE
PRINT 'Committing transaction STRUCTURE'
IF @@TRANCOUNT>0
	COMMIT TRANSACTION _STRUCTURE_
GO

SET NOEXEC OFF
-- BEGINNING TRANSACTION DATA
PRINT 'Beginning transaction DATA'
BEGIN TRANSACTION _DATA_
GO


SET NOCOUNT ON
GO



SET NOEXEC OFF

