How can we help you today? How can we help you today?
CHP

Activity overview

Latest activity by CHP

I am seeing this same error as well. I deleted some previously linked databases recently because I no longer needed to track them... could this be a problem? / comments
I am seeing this same error as well. I deleted some previously linked databases recently because I no longer needed to track them... could this be a problem?
0 votes
Hi Brian, Thank you for getting back to this. I think what was missing was the self-referencing part. Here is some sql to generate a simple version of the tables involved. LedgerID here is the ParentID I was talking about above. This should generate the error I was seeing. /****** Object: Table [dbo].[TestAccount] Script Date: 09/16/2009 10:08:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Account]( [AccountID] [uniqueidentifier] NOT NULL, [AccountNumber] [nvarchar](12) NULL, [AccountName] [nvarchar](50) NOT NULL, [AccountType] [int] NOT NULL, [LedgerID] [uniqueidentifier] NULL, [UniqueID] [int] IDENTITY(1,1) NOT NULL, [Version] [datetime] NOT NULL, [FinYearID] [uniqueidentifier] NOT NULL, CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED ( [UniqueID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [UK_AccountID_FinYearID] UNIQUE NONCLUSTERED ( [AccountID] ASC, [FinYearID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [UK_AccountName_FinYearID] UNIQUE NONCLUSTERED ( [AccountName] ASC, [FinYearID] 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 ALTER TABLE [dbo].[Account] WITH CHECK ADD CONSTRAINT [FK_LedgerID_AccountID] FOREIGN KEY([LedgerID], [FinYearID]) REFERENCES [dbo].[Account] ([AccountID], [FinYearID]) GO ALTER TABLE [dbo].[Account] CHECK CONSTRAINT [FK_LedgerID_AccountID] GO ALTER TABLE [dbo].[Account] WITH CHECK ADD CONSTRAINT [AccountTypeRule] CHECK (([AccountType]=(1) OR [AccountType]=(2) OR [AccountType]=(3) OR [AccountType]=(4) OR [AccountType]=(5))) GO ALTER TABLE [dbo].[Account] CHECK CONSTRAINT [AccountTypeRule] GO CREATE TABLE [dbo].[FinancialYear]( [FinYearID] [uniqueidentifier] NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NOT NULL, [Version] [datetime] NOT NULL, [UniqueID] [int] IDENTITY(1,1) NOT NULL, CONSTRAINT [PK_FinancialYear] PRIMARY KEY CLUSTERED ( [UniqueID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [IX_FinYearGuid] UNIQUE NONCLUSTERED ( [FinYearID] 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].[Account] WITH CHECK ADD CONSTRAINT [FK_Account_FinancialYear] FOREIGN KEY([FinYearID]) REFERENCES [dbo].[FinancialYear] ([FinYearID]) GO ALTER TABLE [dbo].[Account] CHECK CONSTRAINT [FK_Account_FinancialYear] The error is in the Account table: "Generation stopped. The generator for column LedgerID could not generate any more values. / comments
Hi Brian, Thank you for getting back to this. I think what was missing was the self-referencing part. Here is some sql to generate a simple version of the tables involved. LedgerID here is the P...
0 votes
Foreign key generator with compound key
We're using SQL Data Generator 1.2. We have a table that is self-referential based on a compound key. (In an accounting program, it's a parent-child relationship, they're accounts, and can have pa...
2 followers 8 comments 0 votes