Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNDE-2043 #126

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ BEGIN
' WHERE
ix.D_INTERVIEW_KEY IS NOT NULL;';

SELECT @Update_sql;

exec sp_executesql @Update_sql;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
DROP TABLE IF EXISTS dbo.nrt_interview_key;
-- table is not dropped and recreated, as D_INTERVIEW_KEY does not retain the key-uid relationship

CREATE TABLE dbo.nrt_interview_key (
d_interview_key bigint IDENTITY(1,1) NOT NULL,
interview_uid bigint NULL
);
IF NOT EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_interview_key' and xtype = 'U')
joshua-mills-cdw marked this conversation as resolved.
Show resolved Hide resolved
BEGIN

declare @max bigint;
select @max=max(D_INTERVIEW_KEY)+1 from dbo.D_INTERVIEW;
select @max;
if @max IS NULL --check when max is returned as null
SET @max = 1;
DBCC CHECKIDENT ('dbo.nrt_interview_key', RESEED, @max);
CREATE TABLE dbo.nrt_interview_key (
d_interview_key bigint IDENTITY (1,1) NOT NULL,
interview_uid bigint NULL
);
declare @max bigint;
select @max=max(d_interview_key)+1 from dbo.D_INTERVIEW ;
select @max;
if @max IS NULL --check when max is returned as null
joshua-mills-cdw marked this conversation as resolved.
Show resolved Hide resolved
SET @max = 2; -- default to 2, as default record with key = 1 is not stored in D_INTERVIEW
DBCC CHECKIDENT ('dbo.nrt_interview_key', RESEED, @max);

END
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
DROP TABLE IF EXISTS dbo.nrt_interview_note_key;
-- table is not dropped and recreated so as to stay consistent with the design of nrt_interview_key

CREATE TABLE dbo.nrt_interview_note_key (
d_interview_note_key bigint IDENTITY(1,1) NOT NULL,
d_interview_key bigint NOT NULL,
nbs_answer_uid bigint NULL
);
IF NOT EXISTS (SELECT 1 FROM sysobjects WHERE name = 'nrt_interview_note_key' and xtype = 'U')
BEGIN

declare @max bigint;
select @max=max(D_INTERVIEW_NOTE_KEY)+1 from dbo.D_INTERVIEW_NOTE;
select @max;
if @max IS NULL --check when max is returned as null
SET @max = 1;
DBCC CHECKIDENT ('dbo.nrt_interview_note_key', RESEED, @max);
CREATE TABLE dbo.nrt_interview_note_key (
d_interview_note_key bigint IDENTITY(1,1) NOT NULL,
d_interview_key bigint NOT NULL,
nbs_answer_uid bigint NULL
);
declare @max bigint;
select @max=max(d_interview_note_key)+1 from dbo.D_INTERVIEW_NOTE ;
select @max;
if @max IS NULL --check when max is returned as null
SET @max = 2; -- default to 2, as default record with key = 1 is not stored in D_INTERVIEW_NOTE
DBCC CHECKIDENT ('dbo.nrt_interview_note_key', RESEED, @max);

END