CREATE TABLE [dbo].[sq_sequences_counters]
(
[seqc_sequence_code] [dbo].[ais_code_short] NOT NULL,
[seqc_prefix] [dbo].[ais_code_medium] NOT NULL,
[seqc_counter_value] [int] NOT NULL CONSTRAINT [DF_sq_sequences_counters_seqc_counter_value] DEFAULT ((0)),
[seqc_number] [dbo].[ais_code_long] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sq_sequences_counters] ADD CONSTRAINT [PK_sq_sequences_counters] PRIMARY KEY CLUSTERED  ([seqc_sequence_code], [seqc_prefix], [seqc_counter_value]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sq_sequences_counters] ADD CONSTRAINT [FK_sq_sequences_counters_sq_sequences] FOREIGN KEY ([seqc_sequence_code]) REFERENCES [dbo].[sq_sequences] ([seq_sequence_code]) ON DELETE CASCADE
GO
