USE [DD_ECM]
GO

/****** Object:  Table [dbo].[TBDEX_TMP_PROCESS]    Script Date: 07.12.2025 23:29:04 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[TBDEX_TMP_PROCESS]
(
	[GUID] [bigint] IDENTITY(1,1) NOT NULL,
	[PROFILE_ID] [bigint] NOT NULL,
	[BATCH_ID] [nvarchar](25) COLLATE Latin1_General_CI_AS NOT NULL,
	[TBDEX_TMP_TABLE_SCHEMA] [nvarchar](15) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_NAME] [nvarchar](128) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_SCHEMA_AND_NAME] [nvarchar](150) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_COLUMNS] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_DROP_QUERY] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_CREATE_QUERY] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_INSERT_QUERY] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
	[TBDEX_TMP_TABLE_CONTENT] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL,
	[COMMENT] [nvarchar](150) COLLATE Latin1_General_CI_AS NULL,
	[ADDED_WHO] [nvarchar](50) COLLATE Latin1_General_CI_AS NOT NULL,
	[ADDED_WHEN] [datetime] NOT NULL,
	[CHANGED_WHO] [nvarchar](50) COLLATE Latin1_General_CI_AS NULL,
	[CHANGED_WHEN] [datetime] NULL,

 CONSTRAINT [PK_TBDEX_TMP_PROCESS]  PRIMARY KEY NONCLUSTERED 
(
	[GUID] ASC
)
)WITH ( MEMORY_OPTIMIZED = ON , DURABILITY = SCHEMA_ONLY )
GO

ALTER TABLE [dbo].[TBDEX_TMP_PROCESS] ADD  CONSTRAINT [DF_TBDEX_TMP_PROCESS_ADDED_WHO]  DEFAULT ('DEFAULT') FOR [ADDED_WHO]
GO

ALTER TABLE [dbo].[TBDEX_TMP_PROCESS] ADD  CONSTRAINT [DF_TBDEX_TMP_PROCESS_ADDED_WHEN]  DEFAULT (getdate()) FOR [ADDED_WHEN]
GO

ALTER TABLE [dbo].[TBDEX_TMP_PROCESS] ADD INDEX [IX_TBDEX_TMP_PROCESS_PROFILE_BATCH] NONCLUSTERED ([PROFILE_ID],[BATCH_ID]);
GO


