What are the challenges you face when working across database platforms? Take the survey
Options

Data Generator fails on bridge table

emmanuelbuahemmanuelbuah Posts: 5
Below is my table structure for which im trying to generate test data. I have the project configured to generate 1 business, 7 businessgroups , 1000 businessmemebers and 1500 businessgroupmembers. Business, businessgroup and businessmember generates without error but businessgroupmembers fails. Is this a bug or I'm missing something here.

/****** Object:  Table [dbo].[Business]    Script Date: 10/22/2010 07:58:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Business](
	[BusinessId] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [Business_PK] PRIMARY KEY CLUSTERED 
(
	[BusinessId] 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].[BusinessGroup]    Script Date: 10/22/2010 07:58:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BusinessGroup](
	[BusinessId] [int] NOT NULL,
	[BusinessGroupId] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_BusinessGroup] PRIMARY KEY CLUSTERED 
(
	[BusinessId] ASC,
	[BusinessGroupId] 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

ALTER TABLE [dbo].[BusinessGroup]  WITH NOCHECK ADD  CONSTRAINT [Business_FK_BusinessGroup] FOREIGN KEY([BusinessId])
REFERENCES [dbo].[Business] ([BusinessId])
GO

ALTER TABLE [dbo].[BusinessGroup] CHECK CONSTRAINT [Business_FK_BusinessGroup]
GO




/****** Object:  Table [dbo].[BusinessGroupMember]    Script Date: 10/22/2010 07:58:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BusinessGroupMember](
	[BusinessMemberId] [int] NOT NULL,
	[BusinessGroupId] [int] NOT NULL,
	[BusinessGroupBusinessId] [int] NOT NULL,
	[BusinessMemberBusinessId] [int] NOT NULL
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[BusinessGroupMember]  WITH NOCHECK ADD  CONSTRAINT [FK_BusinessGroupMember_BusinessGroup1] FOREIGN KEY([BusinessGroupBusinessId], [BusinessGroupId])
REFERENCES [dbo].[BusinessGroup] ([BusinessId], [BusinessGroupId])
GO

ALTER TABLE [dbo].[BusinessGroupMember] CHECK CONSTRAINT [FK_BusinessGroupMember_BusinessGroup1]
GO

ALTER TABLE [dbo].[BusinessGroupMember]  WITH NOCHECK ADD  CONSTRAINT [FK_BusinessGroupMember_BusinessMember] FOREIGN KEY([BusinessMemberBusinessId], [BusinessMemberId])
REFERENCES [dbo].[BusinessMember] ([BusinessId], [BusinessMemberId])
GO

ALTER TABLE [dbo].[BusinessGroupMember] CHECK CONSTRAINT [FK_BusinessGroupMember_BusinessMember]
GO


USE [WorkSpace]
GO

/****** Object:  Table [dbo].[BusinessMember]    Script Date: 10/22/2010 07:58:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BusinessMember](
	[BusinessId] [int] NOT NULL,
	[BusinessMemberId] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_BusinessMember_1] PRIMARY KEY CLUSTERED 
(
	[BusinessId] ASC,
	[BusinessMemberId] 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

ALTER TABLE [dbo].[BusinessMember]  WITH NOCHECK ADD  CONSTRAINT [Business_FK_BusinessMember] FOREIGN KEY([BusinessId])
REFERENCES [dbo].[Business] ([BusinessId])
GO

ALTER TABLE [dbo].[BusinessMember] CHECK CONSTRAINT [Business_FK_BusinessMember]
GO

Comments

Sign In or Register to comment.