Hi Brian,
Here is a script for one of the tables.
Note that there are 2 foreign keys for tables "APPLICANTS" (Identity column
APPLICANT_ID) and "CAMPUSES" (nvarchar(2) column CAMPUS_ID). You can either
create 2 dummy tables with these fields, to ensure the script works, or
remove the foreign key constraints.
Best regards,
Peter
<---- Script Follows
/****** Object: Table [dbo].[INVOICES] Script Date: 25/07/2002 2:21:23
p.m. ******/
CREATE TABLE [INVOICES] (
[INVOICE_ID] [int] NOT NULL ,
[GUID_INVOICE] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT
[DF_INVOICES_GUID_INVOICE] DEFAULT (newid()),
[APPLICANT_ID] [int] NULL ,
[CAMPUS_ID] [nvarchar] (2) COLLATE Latin1_General_CI_AS NULL ,
[DATE] [datetime] NULL CONSTRAINT [DF__INVOICES__DATE__4AB81AF0] DEFAULT
(convert(datetime,convert(varchar,getdate(),1),1)),
[SHOW_IN_QUERIES] [bit] NOT NULL CONSTRAINT
[DF__INVOICES__SHOW_I__4BAC3F29] DEFAULT (1),
[COMMISSION_PREPAID] [bit] NOT NULL CONSTRAINT
[DF__INVOICES__COMMIS__4CA06362] DEFAULT (0),
[NOTES] [nvarchar] (1024) COLLATE Latin1_General_CI_AS NULL ,
[upsize_ts] [timestamp] NULL ,
[CANCELLED] [bit] NULL CONSTRAINT [DF_INVOICES_CANCELLED] DEFAULT (0),
CONSTRAINT [INVOICES_PK] PRIMARY KEY NONCLUSTERED
(
[INVOICE_ID]
) ON [PRIMARY] ,
CONSTRAINT [FK_INVOICES_APPLICANTS] FOREIGN KEY
(
[APPLICANT_ID]
) REFERENCES [APPLICANTS] (
[APPLICANT_ID]
) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT [FK_INVOICES_LOOKUP_CAMPUSES] FOREIGN KEY
(
[CAMPUS_ID]
) REFERENCES [LOOKUP_CAMPUSES] (
[CAMPUS_ID]
) ON UPDATE CASCADE
) ON [PRIMARY]
GO
exec sp_addextendedproperty N'Attributes', N'0', N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'ColIsGuid', N's_GUID', N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'DateCreated', N'29/01/2002 2:49:35 p.m.',
N'user', N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'LastUpdated', N'26/02/2002 7:12:59 p.m.',
N'user', N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'MS_DefaultView', 2, N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'MS_Filter', null, N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'MS_LinkChildFields', N'INVOICE_ID', N'user',
N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'MS_LinkMasterFields', N'INVOICE_ID', N'user',
N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'MS_OrderBy', null, N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'MS_OrderByOn', 0x00, N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'MS_Orientation', 0, N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'MS_SubdatasheetName', N'dbo.INVOICE_ITEMS',
N'user', N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'MS_TableMaxRecords', 0, N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'Name', N'INVOICES', N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'OrderByOn', N'False', N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'Orientation', N'0', N'user', N'dbo', N'table',
N'INVOICES'
GO
exec sp_addextendedproperty N'RecordCount', N'319', N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'Updatable', N'True', N'user', N'dbo',
N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'ValidationRule',
N'IsNull("INVOICE_ID")=False', N'user', N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'ValidationText', N'Please supply an invoice
number, this is a required field.', N'user', N'dbo', N'table', N'INVOICES'
GO
exec sp_addextendedproperty N'AllowZeroLength', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'Attributes', N'1', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'CollatingOrder', N'1033', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'ColumnHidden', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'ColumnOrder', N'0', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'ColumnWidth', N'-1', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'DataUpdatable', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'GUID', N'????????', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_BoundColumn', N'1', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_Caption', N'Applicant', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnCount', N'2', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnHeads', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnHidden', 0x00, N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnOrder', 0, N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnWidth', 65535, N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ColumnWidths', N'0;1440', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_DecimalPlaces', N'255', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_Description', N'The applicant this invoice
is being issued for', N'user', N'dbo', N'table', N'INVOICES', N'column',
N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_DisplayControl', N'111', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_LimitToList', N'-1', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ListRows', N'8', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_ListWidth', N'1440twip', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_RowSource', N'SELECT
APPLICANTS.APPLICANT_ID, APPLICANTS.NAME
FROM APPLICANTS', N'user', N'dbo', N'table', N'INVOICES', N'column',
N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'MS_RowSourceType', N'Table/View/StoredProc',
N'user', N'dbo', N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'Name', N'APPLICANT_ID', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'OrdinalPosition', N'5', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'Required', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'Size', N'4', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'SourceField', N'APPLICANT_ID', N'user',
N'dbo', N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'SourceTable', N'INVOICES', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'Type', N'4', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'ValidationRule', N'Is Not Null', N'user',
N'dbo', N'table', N'INVOICES', N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'ValidationText', N'Please select an applicant,
this is a required field.', N'user', N'dbo', N'table', N'INVOICES',
N'column', N'APPLICANT_ID'
GO
exec sp_addextendedproperty N'AllowZeroLength', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'Attributes', N'2', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'CollatingOrder', N'1033', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'ColumnHidden', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'ColumnOrder', N'0', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'ColumnWidth', N'-1', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'DataUpdatable', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'GUID', N'????????', N'user', N'dbo', N'table',
N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_BoundColumn', N'1', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_Caption', N'Campus', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnCount', N'2', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnHeads', N'False', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnHidden', 0x00, N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnOrder', 0, N'user', N'dbo', N'table',
N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnWidth', 1635, N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_ColumnWidths', N'0;1905', N'user', N'dbo',
N'table', N'INVOICES', N'column', N'CAMPUS_ID'
GO
exec sp_addextendedproperty N'MS_Description', N'Campus where this applicant
intends to study', N'user', N'dbo', N'table', N'INVOICES', N'column',
N'CAMPUS_ID'
GO
exec
...
read more »