USE [markus_SECtest] GO /****** Object: User [MarkusCA] Script Date: 2023-05-30 오전 10:22:07 ******/ IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'MarkusCA') CREATE USER [MarkusCA] FOR LOGIN [MarkusCA] WITH DEFAULT_SCHEMA=[dbo] GO ALTER ROLE [db_accessadmin] ADD MEMBER [MarkusCA] GO /****** Object: Schema [SignalR] Script Date: 2023-05-30 오전 10:22:07 ******/ IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'SignalR') EXEC sys.sp_executesql N'CREATE SCHEMA [SignalR]' GO /****** Object: UserDefinedTableType [dbo].[TYPE_INSERT_DOCPAGE] Script Date: 2023-05-30 오전 10:22:07 ******/ IF NOT EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'TYPE_INSERT_DOCPAGE' AND ss.name = N'dbo') CREATE TYPE [dbo].[TYPE_INSERT_DOCPAGE] AS TABLE( [DOCINFO_ID] [nvarchar](50) NOT NULL, [PAGE_NUMBER] [int] NOT NULL, [PAGE_WIDTH] [nvarchar](20) NOT NULL, [PAGE_HEIGHT] [nvarchar](20) NOT NULL, [PAGE_ANGLE] [int] NOT NULL ) GO GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ControlType]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ControlType]( [TypeName] [varchar](50) NOT NULL, [TypeValue] [int] NOT NULL, [IsText] [int] NOT NULL, CONSTRAINT [PK_ControlType] PRIMARY KEY CLUSTERED ( [TypeName] ASC, [TypeValue] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[DOCINFO] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DOCINFO]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[DOCINFO]( [ID] [nvarchar](50) NOT NULL, [ORIGINAL_FILE] [nvarchar](500) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [PAGE_COUNT] [int] NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, CONSTRAINT [PK_DOCINFO] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[MARKUP_DATA] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MARKUP_DATA]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MARKUP_DATA]( [ID] [nvarchar](50) NOT NULL, [PAGENUMBER] [int] NOT NULL, [DATA] [nvarchar](max) NOT NULL, [MARKUPINFO_VERSION_ID] [nvarchar](50) NOT NULL, [DATA_TYPE] [int] NOT NULL, [SYMBOL_ID] [nvarchar](50) NULL, [REMARK] [varchar](40) NULL, [InsertTime] [datetime] NULL, CONSTRAINT [PK_MARKUP_DATA] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[MARKUP_INFO] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MARKUP_INFO]( [ID] [nvarchar](50) NOT NULL, [DOCINFO_ID] [nvarchar](50) NOT NULL, [USER_ID] [nvarchar](50) NOT NULL, [CREATE_TIME] [datetime] NOT NULL, [CONSOLIDATE] [int] NOT NULL, [DESCRIPTION] [nvarchar](500) NULL, [AVOID_CONSOLIDATE] [int] NOT NULL, [PART_CONSOLIDATE] [int] NOT NULL, [UPDATE_TIME] [datetime] NULL, CONSTRAINT [PK_MARKUP_INFO] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[MARKUP_INFO_VERSION] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO_VERSION]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MARKUP_INFO_VERSION]( [ID] [nvarchar](50) NOT NULL, [MARKUPINFO_ID] [nvarchar](50) NOT NULL, [CREATE_DATE] [datetime] NOT NULL, CONSTRAINT [PK_MARKUP_INFO_VERSION] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[MEMBER] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MEMBER]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MEMBER]( [ID] [nvarchar](50) NOT NULL, [DEPARTMENT] [nvarchar](50) NULL, [NAME] [nvarchar](50) NOT NULL, [POSITION] [nvarchar](50) NULL, [EMAIL_ADDRESS] [nvarchar](50) NULL, [PASSWORD] [nvarchar](100) NULL, [COMPANY] [nvarchar](50) NULL, [CREATE_DATETIME] [datetime] NULL, [MODIFIED_DATETIME] [datetime] NULL, [ISLICENSE] [int] NULL, CONSTRAINT [PK_MEMBER] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: View [dbo].[ViewMarkupData] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ViewMarkupData]')) EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[ViewMarkupData] AS SELECT dbo.DOCINFO.PROJECT_NO, dbo.DOCINFO.DOCUMENT_ID, dbo.MARKUP_DATA.ID AS MARKUP_DATA_ID, dbo.MARKUP_DATA.PAGENUMBER, dbo.MarkupDataText(dbo.MARKUP_DATA.DATA) AS Text, dbo.MARKUP_INFO_VERSION.CREATE_DATE, dbo.MEMBER.NAME FROM dbo.MARKUP_DATA INNER JOIN dbo.ControlType ON dbo.MARKUP_DATA.DATA_TYPE = dbo.ControlType.TypeValue INNER JOIN dbo.DOCINFO INNER JOIN dbo.MARKUP_INFO ON dbo.DOCINFO.ID = dbo.MARKUP_INFO.DOCINFO_ID INNER JOIN dbo.MARKUP_INFO_VERSION ON dbo.MARKUP_INFO.ID = dbo.MARKUP_INFO_VERSION.MARKUPINFO_ID ON dbo.MARKUP_DATA.MARKUPINFO_VERSION_ID = dbo.MARKUP_INFO_VERSION.ID INNER JOIN dbo.MEMBER ON dbo.MARKUP_INFO.USER_ID = dbo.MEMBER.ID WHERE (dbo.ControlType.IsText = 1) ' GO /****** Object: Table [dbo].[ATTACH_URL] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ATTACH_URL]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ATTACH_URL]( [ID] [int] IDENTITY(1,1) NOT NULL, [GROUP_ID] [nvarchar](50) NOT NULL, [ATTACH_URL1] [nvarchar](500) NOT NULL, [FILE_NAME] [nvarchar](500) NOT NULL, [CREATE_USER_ID] [nvarchar](50) NOT NULL, [CREATE_DATE] [datetime] NOT NULL, CONSTRAINT [PK_ATTACH_URL] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[CHECK_LIST] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CHECK_LIST]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[CHECK_LIST]( [ID] [nvarchar](50) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [USER_ID] [nvarchar](50) NOT NULL, [REVISION] [nvarchar](50) NOT NULL, [PAGENUMBER] [int] NOT NULL, [TODOLIST] [nvarchar](max) NULL, [IMAGE_URL] [nvarchar](max) NOT NULL, [STATUS] [nvarchar](10) NOT NULL, [VENDOR] [nvarchar](500) NULL, [REMARK] [nvarchar](max) NULL, [PROJECT_NO] [nvarchar](50) NOT NULL, [REV_4] [nvarchar](50) NULL, [REV_3] [nvarchar](50) NULL, [REV_2] [nvarchar](50) NULL, [REV_1] [nvarchar](50) NULL, [REV_0] [nvarchar](50) NULL, [IMAGE_ANCHOR] [nvarchar](50) NOT NULL, [CREATE_TIME] [datetime] NULL, [UPDATE_TIME] [datetime] NULL, [STATUS_DESC_OPEN] [nvarchar](max) NULL, [STATUS_DESC_CLOSE] [nvarchar](max) NULL, [REPLY] [nvarchar](max) NULL, [DOCUMENT_NO] [nvarchar](50) NULL, CONSTRAINT [PK_CHECK_LIST] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[CHECK_LIST_HISTORY] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CHECK_LIST_HISTORY]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[CHECK_LIST_HISTORY]( [ID] [nvarchar](50) NOT NULL, [CHECKLIST_ID] [nvarchar](50) NOT NULL, [REVISION] [nvarchar](50) NOT NULL, [STATUS] [nvarchar](10) NOT NULL, [STATUS_DESC] [nvarchar](max) NULL, [TODOLIST] [nvarchar](max) NULL, [VENDOR] [nvarchar](500) NULL, [REMARK] [nvarchar](max) NULL, [REPLY] [nvarchar](max) NULL, [IMAGE_URL] [nvarchar](max) NULL, [CREATE_TIME] [datetime] NOT NULL, [UPDATE_TIME] [datetime] NOT NULL, CONSTRAINT [PK_CHECK_LIST_HISTORY] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[CONVERTER_DOC] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERTER_DOC]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[CONVERTER_DOC]( [ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [DOCUMENT_URL] [nvarchar](500) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [CREATE_DATETIME] [datetime] NOT NULL, [STATUS] [int] NOT NULL, [TOTAL_PAGE] [int] NOT NULL, [CURRENT_PAGE] [int] NOT NULL, [EXCEPTION] [nvarchar](max) NULL, [END_DATETIME] [datetime] NULL, [START_DATETIME] [datetime] NULL, [SERVICE_ID] [nvarchar](50) NULL, [RECONVERTER] [int] NOT NULL, CONSTRAINT [PK_CONVERTER_DOC] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[DOCPAGE] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DOCPAGE]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[DOCPAGE]( [ID] [nvarchar](50) NOT NULL, [DOCINFO_ID] [nvarchar](50) NOT NULL, [PAGE_NUMBER] [int] NOT NULL, [PAGE_WIDTH] [nvarchar](20) NOT NULL, [PAGE_HEIGHT] [nvarchar](20) NOT NULL, [PAGE_ANGLE] [int] NOT NULL, CONSTRAINT [PK_DOCPAGE] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[DOCUMENT_ITEM] Script Date: 2023-05-30 오전 10:22:07 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DOCUMENT_ITEM]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[DOCUMENT_ITEM]( [ID] [nvarchar](50) NOT NULL, [REVISION] [nvarchar](50) NOT NULL, [DOCUMENT_NO] [nvarchar](50) NOT NULL, [DOCUMENT_NAME] [nvarchar](500) NOT NULL, [GROUP_NO] [nvarchar](50) NULL, [ORIGINAL_FILE] [nvarchar](500) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [RESULT_FILE] [nvarchar](500) NULL, [RESULT] [nvarchar](50) NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [Link] [nvarchar](500) NULL, [CreateDate] [datetime] NULL, [ENSEMBLEINFO_URL] [nvarchar](500) NULL, [createDate2] [datetime] NULL, CONSTRAINT [PK_DOCUMENT_ITEM] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[ERROR_LOG] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ERROR_LOG]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[ERROR_LOG]( [ID] [int] IDENTITY(1,1) NOT NULL, [SERVICE_NAME] [nvarchar](30) NOT NULL, [LEVEL] [nvarchar](10) NULL, [TYPE] [nvarchar](10) NULL, [CONTENTS] [nvarchar](max) NULL, [CREATE_DATETIME] [nvarchar](max) NOT NULL, [CODE] [nvarchar](10) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, CONSTRAINT [PK_ERROR_LOG] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[FAVORITE_DOC] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FAVORITE_DOC]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[FAVORITE_DOC]( [ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [GROUP_NO] [nvarchar](50) NOT NULL, [DOCUMENT_NO] [nvarchar](50) NOT NULL, [MEMBER_USER_ID] [nvarchar](50) NOT NULL, [DESCRIPTION] [nvarchar](max) NULL, [CREATE_TIME] [datetime] NOT NULL, [FLAG] [int] NOT NULL, [REVISION] [nvarchar](50) NOT NULL, [PAGE_NO] [int] NOT NULL, CONSTRAINT [PK_FAVORIT_DOC] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[FINAL_PDF] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FINAL_PDF]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[FINAL_PDF]( [ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [DOCINFO_ID] [nvarchar](50) NOT NULL, [MARKUPINFO_ID] [nvarchar](50) NOT NULL, [CREATE_USER_ID] [nvarchar](50) NOT NULL, [CREATE_DATETIME] [datetime] NOT NULL, [STATUS] [int] NOT NULL, [TOTAL_PAGE] [int] NOT NULL, [CURRENT_PAGE] [int] NOT NULL, [EXCEPTION] [nvarchar](max) NULL, [END_DATETIME] [datetime] NULL, [START_DATETIME] [datetime] NULL, [DOCUMENT_ID] [nvarchar](50) NULL, [SERVICE_ID] [nvarchar](50) NULL, CONSTRAINT [PK_FINAL_PDF] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[LICENSE_LOG] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LICENSE_LOG]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[LICENSE_LOG]( [ID] [int] IDENTITY(1,1) NOT NULL, [USER_ID] [nvarchar](30) NOT NULL, [USER_NAME] [nvarchar](20) NOT NULL, [CONNECTION_ID] [nvarchar](50) NOT NULL, [EVENT_TIME] [datetime] NOT NULL, [STATUS] [int] NOT NULL, [DESCRIPTION] [nvarchar](50) NULL, CONSTRAINT [PK_LICENSE_LOG] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[LOGIN_STAMP] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LOGIN_STAMP]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[LOGIN_STAMP]( [ID] [nvarchar](50) NOT NULL, [USER_ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [START_DATETIME] [datetime] NOT NULL, [END_DATETIME] [datetime] NULL, [ISLOGIN] [int] NOT NULL, CONSTRAINT [PK_LOGIN_STAMP] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[MARKUP_CHECKLIST] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MARKUP_CHECKLIST]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[MARKUP_CHECKLIST]( [CK_NO] [int] IDENTITY(1,1) NOT NULL, [CK_REV_NO] [nvarchar](10) NULL, [CK_PAGE] [int] NULL, [CK_COMMENT] [nvarchar](200) NULL, [CK_TODO] [nvarchar](200) NULL, [CK_STATUS] [nvarchar](10) NULL, [CK_RESULT] [nvarchar](10) NULL, CONSTRAINT [PK_MARKUP_CHECKLIST] PRIMARY KEY CLUSTERED ( [CK_NO] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[NOTIFICATION_LIST] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NOTIFICATION_LIST]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[NOTIFICATION_LIST]( [ID] [nvarchar](50) NOT NULL, [USER_ID] [nvarchar](200) NULL, [CREATEDATE] [datetime] NULL, [TEXT] [nvarchar](200) NULL, CONSTRAINT [PK_NOTIFICATION_LIST] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[PRINT_DOC] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PRINT_DOC]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PRINT_DOC]( [ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [DOCINFO_ID] [nvarchar](50) NOT NULL, [CREATE_USER_ID] [nvarchar](50) NOT NULL, [STATUS] [int] NOT NULL, [CURRENT_PAGE] [int] NOT NULL, [TOTAL_PAGE] [int] NOT NULL, [EXCEPTION] [nvarchar](max) NULL, [START_DATETIME] [datetime] NOT NULL, [END_DATETIME] [datetime] NULL, [IS_EXPORT_FILE] [int] NOT NULL, [PRINT_PAGES] [int] NOT NULL, [PDFURL] [nvarchar](max) NOT NULL, [IS_ONLY_RED] [int] NOT NULL, CONSTRAINT [PK_PRINT_DOC] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[PRINT_EXCEL] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PRINT_EXCEL]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PRINT_EXCEL]( [ID] [nvarchar](50) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [GROUP_NO] [nvarchar](50) NOT NULL, [CREATE_USER_ID] [nvarchar](50) NOT NULL, [START_DATETIME] [datetime] NOT NULL, [END_DATETIME] [datetime] NULL, [EXCEPTION] [nvarchar](500) NULL, [STATUS] [int] NOT NULL, [DOCUMENT_ID_SET] [nvarchar](50) NOT NULL, [FILE_PATH] [nvarchar](max) NULL, CONSTRAINT [PK_PRINT_EXCEL] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[PROJECT_SETTING] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PROJECT_SETTING]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PROJECT_SETTING]( [ID] [int] IDENTITY(1,1) NOT NULL, [PROJECT_NO] [nvarchar](10) NOT NULL, [REVISION] [nvarchar](30) NOT NULL, [RESULT] [nvarchar](30) NOT NULL, CONSTRAINT [PK_PROJECT_SETTING] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[PROPERTIES] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PROPERTIES]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[PROPERTIES]( [ID] [int] IDENTITY(1,1) NOT NULL, [TYPE] [nvarchar](50) NOT NULL, [PROPERTY] [nvarchar](100) NOT NULL, [VALUE] [varchar](max) NOT NULL, CONSTRAINT [PK_PROPERTIES] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[RUN_PROJECTS] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RUN_PROJECTS]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[RUN_PROJECTS]( [PROJECT_NO] [nvarchar](10) NOT NULL, [PROJECT_NAME] [nvarchar](50) NOT NULL, [RUN_DATETIME] [datetime] NOT NULL, [IS_ACTIVITY] [int] NOT NULL, CONSTRAINT [PK_RUN_PROJECTS] PRIMARY KEY CLUSTERED ( [PROJECT_NO] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[SERVICE_PROPERTIES] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SERVICE_PROPERTIES]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[SERVICE_PROPERTIES]( [ID] [nvarchar](50) NOT NULL, [SERVICE_TYPE] [int] NOT NULL, [SERVICE_ADDRESS] [nvarchar](100) NULL, [SERVICE_PORT] [int] NULL, [HOST_NAME] [nvarchar](100) NOT NULL, [PROCESS_COUNT] [int] NOT NULL, CONSTRAINT [PK_SERVICE_PROPERTIES] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[SIGN_INFO] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SIGN_INFO]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[SIGN_INFO]( [ID] [nvarchar](50) NOT NULL, [SIGN_STR] [nvarchar](max) NOT NULL, [MEMBER_USER_ID] [nvarchar](50) NOT NULL, [CREATE_DATE] [datetime] NOT NULL, [MODIFY_DATE] [datetime] NULL, [SIGN_STROKES] [varchar](max) NULL, CONSTRAINT [PK_SIGN_INFO] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[SYMBOL_PRIVATE] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SYMBOL_PRIVATE]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[SYMBOL_PRIVATE]( [ID] [nvarchar](50) NOT NULL, [MEMBER_USER_ID] [nvarchar](50) NOT NULL, [NAME] [nvarchar](500) NOT NULL, [IMAGE_URL] [nvarchar](500) NOT NULL, [DATA] [nvarchar](max) NOT NULL, CONSTRAINT [PK_SYMBOL_PRIVATE] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[SYMBOL_PUBLIC] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SYMBOL_PUBLIC]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[SYMBOL_PUBLIC]( [ID] [nvarchar](50) NOT NULL, [DEPARTMENT] [nvarchar](50) NOT NULL, [IMAGE_URL] [nvarchar](500) NOT NULL, [DATA] [nvarchar](max) NOT NULL, [NAME] [nvarchar](50) NOT NULL, CONSTRAINT [PK_SYMBOL_PUBLIC] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [dbo].[TALK] Script Date: 2023-05-30 오전 10:22:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TALK]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[TALK]( [ID] [int] IDENTITY(1,1) NOT NULL, [TEXT] [nchar](300) NOT NULL, [TIMESTAMP] [datetime] NOT NULL, [MSGTYPE] [tinyint] NOT NULL, [MSGSIDE] [tinyint] NOT NULL, [RECT_X] [float] NULL, [RECT_Y] [float] NULL, [RECT_WIDTH] [float] NULL, [RECT_HEIGHT] [float] NULL, [PAGENUMBER] [int] NULL, [MEMBER_ID] [nvarchar](50) NOT NULL, [DOCUMENT_ID] [nvarchar](50) NOT NULL, [MEMBER_NAME] [nvarchar](50) NOT NULL, [ANGLE] [int] NOT NULL, CONSTRAINT [PK_TALK] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [dbo].[test] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[test]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[test]( [ID] [varchar](50) NULL, [PAGENUMBER] [varchar](50) NULL, [DATA] [varchar](50) NULL, [MARKUPINFO_VERSION_ID] [varchar](50) NULL, [DATA_TYPE] [varchar](50) NULL, [SYMBOL_ID] [varchar](50) NULL, [InsertTime] [varchar](50) NULL ) ON [PRIMARY] END GO /****** Object: Table [SignalR].[Messages_0] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[SignalR].[Messages_0]') AND type in (N'U')) BEGIN CREATE TABLE [SignalR].[Messages_0]( [PayloadId] [bigint] NOT NULL, [Payload] [varbinary](max) NOT NULL, [InsertedOn] [datetime] NOT NULL, PRIMARY KEY CLUSTERED ( [PayloadId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] END GO /****** Object: Table [SignalR].[Messages_0_Id] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[SignalR].[Messages_0_Id]') AND type in (N'U')) BEGIN CREATE TABLE [SignalR].[Messages_0_Id]( [PayloadId] [bigint] NOT NULL, PRIMARY KEY CLUSTERED ( [PayloadId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO /****** Object: Table [SignalR].[Schema] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[SignalR].[Schema]') AND type in (N'U')) BEGIN CREATE TABLE [SignalR].[Schema]( [SchemaVersion] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [SchemaVersion] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] END GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DF_ControlType_IsText]') AND type = 'D') BEGIN ALTER TABLE [dbo].[ControlType] ADD CONSTRAINT [DF_ControlType_IsText] DEFAULT ((0)) FOR [IsText] END GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DF_DOCUMENT_ITEM_CreateDate]') AND type = 'D') BEGIN ALTER TABLE [dbo].[DOCUMENT_ITEM] ADD CONSTRAINT [DF_DOCUMENT_ITEM_CreateDate] DEFAULT (getutcdate()) FOR [CreateDate] END GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DF__MARKUP_DA__Inser__73BA3083]') AND type = 'D') BEGIN ALTER TABLE [dbo].[MARKUP_DATA] ADD DEFAULT (getdate()) FOR [InsertTime] END GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_DOCPAGE_DOCINFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[DOCPAGE]')) ALTER TABLE [dbo].[DOCPAGE] WITH CHECK ADD CONSTRAINT [FK_DOCPAGE_DOCINFO] FOREIGN KEY([DOCINFO_ID]) REFERENCES [dbo].[DOCINFO] ([ID]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_DOCPAGE_DOCINFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[DOCPAGE]')) ALTER TABLE [dbo].[DOCPAGE] CHECK CONSTRAINT [FK_DOCPAGE_DOCINFO] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_MARKUP_INFO_DOCINFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO]')) ALTER TABLE [dbo].[MARKUP_INFO] WITH CHECK ADD CONSTRAINT [FK_MARKUP_INFO_DOCINFO] FOREIGN KEY([DOCINFO_ID]) REFERENCES [dbo].[DOCINFO] ([ID]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_MARKUP_INFO_DOCINFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO]')) ALTER TABLE [dbo].[MARKUP_INFO] CHECK CONSTRAINT [FK_MARKUP_INFO_DOCINFO] GO IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_MARKUP_INFO_VERSION_MARKUP_INFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO_VERSION]')) ALTER TABLE [dbo].[MARKUP_INFO_VERSION] WITH CHECK ADD CONSTRAINT [FK_MARKUP_INFO_VERSION_MARKUP_INFO] FOREIGN KEY([MARKUPINFO_ID]) REFERENCES [dbo].[MARKUP_INFO] ([ID]) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_MARKUP_INFO_VERSION_MARKUP_INFO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MARKUP_INFO_VERSION]')) ALTER TABLE [dbo].[MARKUP_INFO_VERSION] CHECK CONSTRAINT [FK_MARKUP_INFO_VERSION_MARKUP_INFO] GO /****** Object: StoredProcedure [dbo].[CONVERT_INSERT_CONVERTDOC] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_INSERT_CONVERTDOC]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_INSERT_CONVERTDOC] AS' END GO -- ============================================= -- Exec [CONVERT_INSERT_CONVERTDOC] @PROJECT_NO='5',@DOCUMENT_URL='5',@DOCUMENT_ID='5' -- ============================================= -- ============================================= -- Author: 김태성 -- CreateDate : -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CONVERT_INSERT_CONVERTDOC] --@ID AS nvarchar, @PROJECT_NO AS nvarchar(10), @DOCUMENT_URL AS nvarchar(500), @DOCUMENT_ID AS nvarchar(50), @NewID AS varchar(50) OUTPUT AS BEGIN SET NOCOUNT ON; set @newID = REPLACE(cast( NEWID() AS varchar(50)),'-','') INSERT INTO [dbo].[CONVERTER_DOC] ( [ID], [PROJECT_NO], [DOCUMENT_URL], [DOCUMENT_ID], [CREATE_DATETIME], [STATUS], [TOTAL_PAGE], [CURRENT_PAGE], [RECONVERTER], [EXCEPTION], [END_DATETIME], [START_DATETIME], [SERVICE_ID] ) VALUES ( @newID, @PROJECT_NO, @DOCUMENT_URL, @DOCUMENT_ID, GETDATE(), 0, 0, 0, 0, NULL, NULL, NULL, NULL ) RETURN; END GO /****** Object: StoredProcedure [dbo].[CONVERT_INSERT_DOCINFO] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_INSERT_DOCINFO]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_INSERT_DOCINFO] AS' END GO -- ============================================= -- Exec [CONVERT_INSERT_DOCINFO] @CONVERT_ID='1ECA669CCBF14E518378267B333333E5',@PAGE_COUNT=5, @NewID ='', @ErrorCode ='', @Error='' -- ============================================= -- ============================================= -- Author: 김태성 -- CreateDate : -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CONVERT_INSERT_DOCINFO] @CONVERT_ID AS nvarchar(MAX), @PAGE_COUNT AS int, @NewID AS varchar(50) OUTPUT, @ErrorCode AS INT OUTPUT, @Error AS varchar(500) OUTPUT AS BEGIN SET NOCOUNT ON; DECLARE @PROJECT_NO nvarchar(10) DECLARE @DOCUMENT_ID nvarchar(50) DECLARE @ORIGINAL_FILE nvarchar(500) IF EXISTS( SELECT ID FROM [dbo].CONVERTER_DOC WHERE ID = @CONVERT_ID ) BEGIN SELECT @DOCUMENT_ID = DOCUMENT_ID ,@PROJECT_NO = PROJECT_NO ,@ORIGINAL_FILE = DOCUMENT_URL FROM [dbo].CONVERTER_DOC WHERE ID = @CONVERT_ID IF EXISTS( SELECT ID FROM [dbo].[DOCINFO] WHERE DOCUMENT_ID = @DOCUMENT_ID and PROJECT_NO = @PROJECT_NO ) BEGIN UPDATE [dbo].[DOCINFO] SET [ORIGINAL_FILE] = @ORIGINAL_FILE ,[PAGE_COUNT] = @PAGE_COUNT WHERE DOCUMENT_ID = @DOCUMENT_ID and PROJECT_NO = @PROJECT_NO select @newID = ID FROM [dbo].[DOCINFO] WHERE DOCUMENT_ID = @DOCUMENT_ID and PROJECT_NO = @PROJECT_NO END ELSE BEGIN set @newID = REPLACE(cast( NEWID() AS varchar(50)),'-','') INSERT INTO [dbo].[DOCINFO] ( [ID], [ORIGINAL_FILE], [DOCUMENT_ID], [PAGE_COUNT], [PROJECT_NO] ) VALUES ( @newID, @ORIGINAL_FILE, @DOCUMENT_ID, @PAGE_COUNT, @PROJECT_NO ) END SET @ErrorCode = 0 SET @Error = '' END ELSE BEGIN SET @ErrorCode = 99 SET @Error = 'CONVERTER_DOC NOT FOUND' END select @ErrorCode , @Error, @NewID; END GO /****** Object: StoredProcedure [dbo].[CONVERT_INSERT_DOCPAGE] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_INSERT_DOCPAGE]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_INSERT_DOCPAGE] AS' END GO -- ============================================= -- Exec [CONVERT_INSERT_DOCPAGE] @PROJECT_NO='5',@DOCUMENT_URL='5',@DOCUMENT_ID='5' -- ============================================= -- ============================================= -- Author: 김태성 -- CreateDate : -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CONVERT_INSERT_DOCPAGE] @DOCPAGES [TYPE_INSERT_DOCPAGE] READONLY AS BEGIN SET NOCOUNT ON; DELETE FROM DOCPAGE WHERE DOCINFO_ID = ( select top(1) DOCINFO_ID FROM @DOCPAGES) INSERT INTO [dbo].[DOCPAGE] ( [ID], [DOCINFO_ID], [PAGE_NUMBER], [PAGE_WIDTH], [PAGE_HEIGHT], [PAGE_ANGLE] ) SELECT REPLACE(cast( NEWID() AS varchar(50)),'-',''), DOCINFO_ID, PAGE_NUMBER, PAGE_WIDTH, PAGE_HEIGHT, PAGE_ANGLE FROM @DOCPAGES order by PAGE_NUMBER END GO /****** Object: StoredProcedure [dbo].[CONVERT_INSERT_DOCUMENTITEM] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_INSERT_DOCUMENTITEM]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_INSERT_DOCUMENTITEM] AS' END GO ALTER PROCEDURE [dbo].[CONVERT_INSERT_DOCUMENTITEM] @REVISION AS nvarchar(50), @DOCUMENT_NO AS nvarchar(50), @DOCUMENT_NAME AS nvarchar(500), @ORIGINAL_FILE AS nvarchar(500), @DOCUMENT_ID AS nvarchar(50), @PROJECT_NO AS nvarchar(10), @Link AS nvarchar(500), @RESULT_FILE AS nvarchar(500), @RESULT AS nvarchar(50), @GROUP_NO AS nvarchar(50), @NewID AS varchar(50) OUTPUT AS BEGIN SET NOCOUNT ON; IF EXISTS( SELECT ID FROM [dbo].[DOCUMENT_ITEM] WHERE PROJECT_NO = @PROJECT_NO AND DOCUMENT_ID = @DOCUMENT_ID ) BEGIN UPDATE [dbo].[DOCUMENT_ITEM] SET [REVISION] = @REVISION ,[Link] = @Link ,[DOCUMENT_NO] = @DOCUMENT_NO ,[DOCUMENT_NAME] =@DOCUMENT_NAME ,[GROUP_NO] = @GROUP_NO ,[ORIGINAL_FILE] = @ORIGINAL_FILE ,[RESULT_FILE] = @RESULT_FILE ,[RESULT] = @RESULT --,[DOCUMENT_ID] = @DOCUMENT_ID --,[PROJECT_NO] = @PROJECT_NO WHERE PROJECT_NO = @PROJECT_NO AND DOCUMENT_ID = @DOCUMENT_ID SELECT @newID = ID FROM [dbo].[DOCUMENT_ITEM] DOCITEM WHERE PROJECT_NO = @PROJECT_NO AND DOCUMENT_ID = @DOCUMENT_ID END ELSE BEGIN set @newID = REPLACE(cast( NEWID() AS varchar(50)),'-','') INSERT INTO [dbo].[DOCUMENT_ITEM] ([ID] ,[REVISION] ,[DOCUMENT_NO] ,[DOCUMENT_NAME] ,[GROUP_NO] ,[ORIGINAL_FILE] ,[DOCUMENT_ID] ,[RESULT_FILE] ,[RESULT] ,[PROJECT_NO] ,[Link] ,[CreateDate]) VALUES (@newID ,@REVISION ,@DOCUMENT_NO ,@DOCUMENT_NAME ,@GROUP_NO ,@ORIGINAL_FILE ,@DOCUMENT_ID ,@RESULT_FILE ,@RESULT ,@PROJECT_NO ,@Link ,GETDATE()) END END GO /****** Object: StoredProcedure [dbo].[CONVERT_SELECT_CONVERTINGITEMS] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_SELECT_CONVERTINGITEMS]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_SELECT_CONVERTINGITEMS] AS' END GO -- ============================================= -- Exec [CONVERT_SELECT_CONVERTINGITEMS] @TakeCount='5' -- ============================================= -- ============================================= -- Author: 김태성 -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CONVERT_SELECT_CONVERTINGITEMS] ( @TakeCount int ) AS BEGIN SET FMTONLY OFF; SET NOCOUNT ON SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; IF @TakeCount = -1 BEGIN SELECT @TakeCount = COUNT(*) FROM CONVERTER_DOC END SELECT TOP (@TakeCount) CONVERTER_DOC.ID, CONVERTER_DOC.PROJECT_NO, CONVERTER_DOC.DOCUMENT_URL, CONVERTER_DOC.DOCUMENT_ID, CONVERTER_DOC.CREATE_DATETIME, CONVERTER_DOC.STATUS, CONVERTER_DOC.TOTAL_PAGE, CONVERTER_DOC.CURRENT_PAGE, CONVERTER_DOC.EXCEPTION, CONVERTER_DOC.END_DATETIME, CONVERTER_DOC.START_DATETIME, CONVERTER_DOC.SERVICE_ID, CONVERTER_DOC.RECONVERTER FROM CONVERTER_DOC LEFT OUTER JOIN RUN_PROJECTS ON CONVERTER_DOC.PROJECT_NO = RUN_PROJECTS.PROJECT_NO WHERE RUN_PROJECTS.IS_ACTIVITY = 1 AND CONVERTER_DOC.STATUS > 0 AND CONVERTER_DOC.STATUS < 4 AND CONVERTER_DOC.RECONVERTER < 2 ORDER BY CONVERTER_DOC.CREATE_DATETIME SET FMTONLY ON; SET NOCOUNT OFF RETURN END GO /****** Object: StoredProcedure [dbo].[CONVERT_SELECT_WAITorERROR] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_SELECT_WAITorERROR]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_SELECT_WAITorERROR] AS' END GO ALTER PROCEDURE [dbo].[CONVERT_SELECT_WAITorERROR] ( @TakeCount int ) AS BEGIN SET FMTONLY OFF; SET NOCOUNT ON SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT TOP (@TakeCount) [Limit1].[ID] AS [ID],[Limit1].[PROJECT_NO] AS [PROJECT_NO],[Limit1].[DOCUMENT_URL] AS [DOCUMENT_URL], [Limit1].[DOCUMENT_ID] AS [DOCUMENT_ID],[Limit1].[CREATE_DATETIME] AS [CREATE_DATETIME], [Limit1].[STATUS] AS [STATUS],[Limit1].[TOTAL_PAGE] AS [TOTAL_PAGE],[Limit1].[CURRENT_PAGE] AS [CURRENT_PAGE], [Limit1].[EXCEPTION] AS [EXCEPTION],[Limit1].[END_DATETIME] AS [END_DATETIME],[Limit1].[START_DATETIME] AS [START_DATETIME], [Limit1].[SERVICE_ID] AS [SERVICE_ID],[Limit1].[RECONVERTER] AS [RECONVERTER] FROM (SELECT DISTINCT[Extent1].[DOCUMENT_ID] AS [DOCUMENT_ID] FROM [dbo].[CONVERTER_DOC] AS [Extent1] WHERE ([Extent1].[RECONVERTER] < 2) AND ([Extent1].[STATUS] = 0 or [Extent1].[STATUS] > 4)) AS [Distinct1] OUTER APPLY (SELECT TOP (1)[Extent2].[ID] AS [ID],[Extent2].[PROJECT_NO] AS [PROJECT_NO], [Extent2].[DOCUMENT_URL] AS [DOCUMENT_URL],[Extent2].[DOCUMENT_ID] AS [DOCUMENT_ID], [Extent2].[CREATE_DATETIME] AS [CREATE_DATETIME],[Extent2].[STATUS] AS [STATUS], [Extent2].[TOTAL_PAGE] AS [TOTAL_PAGE],[Extent2].[CURRENT_PAGE] AS [CURRENT_PAGE], [Extent2].[EXCEPTION] AS [EXCEPTION],[Extent2].[END_DATETIME] AS [END_DATETIME], [Extent2].[START_DATETIME] AS [START_DATETIME],[Extent2].[SERVICE_ID] AS [SERVICE_ID], [Extent2].[RECONVERTER] AS [RECONVERTER] FROM [dbo].[CONVERTER_DOC] AS [Extent2] WHERE ([Extent2].[RECONVERTER] < 2) AND (([Extent2].[STATUS] = 0 or [Extent2].[STATUS] > 4)) AND ([Distinct1].[DOCUMENT_ID] = [Extent2].[DOCUMENT_ID]) ) AS [Limit1] CROSS APPLY (SELECT PROJECT_NO FROM RUN_PROJECTS WHERE PROJECT_NO = Limit1.PROJECT_NO AND IS_ACTIVITY = 1) PRJ SET FMTONLY ON; SET NOCOUNT OFF RETURN END GO /****** Object: StoredProcedure [dbo].[CONVERT_UPDATE_CLEANUP_ITEM] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_UPDATE_CLEANUP_ITEM]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_UPDATE_CLEANUP_ITEM] AS' END GO ALTER PROCEDURE [dbo].[CONVERT_UPDATE_CLEANUP_ITEM] ( @ConverterDocID nvarchar(max), @ReConvert int ) AS SET FMTONLY OFF; SET NOCOUNT ON UPDATE [dbo].CONVERTER_DOC SET RECONVERTER = RECONVERTER + @ReConvert, CREATE_DATETIME = GETDATE(), END_DATETIME = NULL, SERVICE_ID = NULL, STATUS = 0 where ID = @ConverterDocID if @@ERROR <> 0 BEGIN RETURN(0); end ELSE BEGIN RETURN(1); END SET FMTONLY ON; SET NOCOUNT OFF GO /****** Object: StoredProcedure [dbo].[CONVERT_UPDATE_STATUS] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CONVERT_UPDATE_STATUS]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[CONVERT_UPDATE_STATUS] AS' END GO -- ============================================= -- Exec [CONVERT_UPDATE_STATUS] @SERVICE_ID='',@ID='057FD2FD30644271B8B2B7E292F91CBB',@STATUS='0', @TOTAL_PAGE ='0',@CURRENT_PAGE='0',@EXCEPTION='' -- ============================================= -- ============================================= -- Author: 김태성 -- CreateDate : -- Description: -- ============================================= ALTER PROCEDURE [dbo].[CONVERT_UPDATE_STATUS] @SERVICE_ID AS nvarchar(MAX), @ID AS nvarchar(MAX), @STATUS AS int, @TOTAL_PAGE AS int, @CURRENT_PAGE AS int, @EXCEPTION AS nvarchar(MAX) AS BEGIN SET NOCOUNT OFF; DECLARE @INNER_EXCEPTION AS nvarchar(MAX) SELECT @INNER_EXCEPTION = EXCEPTION FROM CONVERTER_DOC WHERE ID = @ID UPDATE [dbo].[CONVERTER_DOC] SET [STATUS] = @STATUS, [TOTAL_PAGE] = @TOTAL_PAGE, [CURRENT_PAGE] = @CURRENT_PAGE, [SERVICE_ID] = @SERVICE_ID, [EXCEPTION] = CONCAT(@EXCEPTION,@INNER_EXCEPTION), [START_DATETIME] = CASE WHEN @STATUS = 1 THEN GETDATE() ELSE [START_DATETIME] END, [END_DATETIME] = CASE WHEN @STATUS >= 4 THEN GETDATE() ELSE [END_DATETIME] END WHERE [ID] = @ID END GO /****** Object: StoredProcedure [dbo].[GET_MARKUPDATA] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GET_MARKUPDATA]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[GET_MARKUPDATA] AS' END GO ALTER PROCEDURE [dbo].[GET_MARKUPDATA] @PROJECT_NOs [VARCHAR_TABLE] READONLY, @DOCUMENT_IDs [VARCHAR_TABLE] READONLY AS BEGIN SET NOCOUNT ON; CREATE TABLE #prjTable (PROJECT_NO VARCHAR(max)); CREATE TABLE #TempTable (DOCUMENT_ID VARCHAR(max)); INSERT INTO #prjTable (PROJECT_NO) SELECT ITEM FROM @PROJECT_NOs; -- 테이블 형식의 데이터를 임시 테이블에 복사 INSERT INTO #TempTable (DOCUMENT_ID) SELECT ITEM FROM @DOCUMENT_IDs; SELECT dbo.DOCINFO.PROJECT_NO, dbo.DOCINFO.DOCUMENT_ID, dbo.MarkupDataText(dbo.MARKUP_DATA.DATA) AS TEXT, dbo.MARKUP_INFO_VERSION.CREATE_DATE, dbo.MEMBER.NAME FROM dbo.MARKUP_DATA INNER JOIN dbo.ControlType ON dbo.MARKUP_DATA.DATA_TYPE = dbo.ControlType.TypeValue INNER JOIN dbo.DOCINFO INNER JOIN dbo.MARKUP_INFO ON dbo.DOCINFO.ID = dbo.MARKUP_INFO.DOCINFO_ID INNER JOIN dbo.MARKUP_INFO_VERSION ON dbo.MARKUP_INFO.ID = dbo.MARKUP_INFO_VERSION.MARKUPINFO_ID ON dbo.MARKUP_DATA.MARKUPINFO_VERSION_ID = dbo.MARKUP_INFO_VERSION.ID INNER JOIN dbo.MEMBER ON dbo.MARKUP_INFO.USER_ID = dbo.MEMBER.ID WHERE (dbo.ControlType.IsText = 1) AND dbo.DOCINFO.PROJECT_NO IN (SELECT PROJECT_NO FROM #prjTable) AND dbo.DOCINFO.DOCUMENT_ID IN (SELECT DOCUMENT_ID FROM #TempTable); -- 임시 테이블 삭제 DROP TABLE #TempTable; DROP TABLE #prjTable; END GO /****** Object: StoredProcedure [dbo].[TABLE_TO_CALSS] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TABLE_TO_CALSS]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[TABLE_TO_CALSS] AS' END GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= ALTER PROCEDURE [dbo].[TABLE_TO_CALSS] -- Add the parameters for the stored procedure here @TableName SYSNAME, @Result varchar(max) OUTPUT AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here --modified from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table --added table and column --declare @TableName sysname = 'TableName' SET @Result = 'using System.Data.Linq.Mapping; [Table(Name = "' + @TableName + '")] public class ' + @TableName + ' {' select @Result = @Result + ' [Column(DbType = "' + Case when ColumnDbType in ('nvarchar', 'nchar', 'varchar', 'char', 'datetime2', 'binary', 'datetimeoffset', 'time', 'varbinary') then ColumnDbType + '(' + cMlength + ')' when ColumnDbType in ('decimal', 'numeric') then ColumnDbType + '(' + cPrecision + ',' + cScale +')' else ColumnDbType end + '", ' + case ISPK when 'true' then 'IsPrimaryKey = true' else 'CanBeNull = ' + cNullable end +')] public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } ' from ( select distinct replace(col.name, ' ', '_') ColumnName, column_id ColumnId, typ.name ColumnDbType, convert(varchar, col.precision) cPrecision, convert(varchar, col.scale) cScale, convert(varchar, col.max_length) cMlength, case col.is_nullable when 1 then 'true' else 'false' end cNullable, pkk.ISPK, case typ.name when 'bigint' then 'long' when 'binary' then 'byte[]' when 'bit' then 'bool' when 'char' then 'string' when 'date' then 'DateTime' when 'datetime' then 'DateTime' when 'datetime2' then 'DateTime' when 'datetimeoffset' then 'DateTimeOffset' when 'decimal' then 'decimal' when 'float' then 'double' when 'image' then 'byte[]' when 'int' then 'int' when 'money' then 'decimal' when 'nchar' then 'string' when 'ntext' then 'string' when 'numeric' then 'decimal' when 'nvarchar' then 'string' when 'real' then 'float' when 'smalldatetime' then 'DateTime' when 'smallint' then 'short' when 'smallmoney' then 'decimal' when 'text' then 'string' when 'time' then 'TimeSpan' when 'timestamp' then 'long' when 'tinyint' then 'byte' when 'uniqueidentifier' then 'Guid' when 'varbinary' then 'byte[]' when 'varchar' then 'string' else 'UNKNOWN_' + typ.name end ColumnType, case when col.is_nullable = 1 and typ.name in ('bigint', 'bit', 'date', 'datetime', 'datetime2', 'datetimeoffset', 'decimal', 'float', 'int', 'money', 'numeric', 'real', 'smalldatetime', 'smallint', 'smallmoney', 'time', 'tinyint', 'uniqueidentifier') then '?' else '' end NullableSign from sys.columns col join sys.types typ on col.system_type_id = typ.system_type_id AND col.user_type_id = typ.user_type_id left join ( SELECT c.name AS 'ColumnName', CASE WHEN dd.pk IS NULL THEN 'false' ELSE 'true' END ISPK FROM sys.columns c JOIN sys.tables t ON c.object_id = t.object_id LEFT JOIN (SELECT K.COLUMN_NAME , C.CONSTRAINT_TYPE as pk FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C ON K.TABLE_NAME = C.TABLE_NAME AND K.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND K.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG AND K.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA WHERE K.TABLE_NAME = @TableName) as dd ON dd.COLUMN_NAME = c.name WHERE t.name = @TableName ) pkk on ColumnName=col.name where object_id = object_id(@TableName) ) t order by ColumnId set @Result = @Result + ' }' print @Result END GO /****** Object: StoredProcedure [dbo].[TEST_CONVERT_PROC] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TEST_CONVERT_PROC]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[TEST_CONVERT_PROC] AS' END GO ALTER PROCEDURE [dbo].[TEST_CONVERT_PROC] AS BEGIN SET NOCOUNT ON; DECLARE @DOCUMENT_ID nvarchar(50) DECLARE @PROJECT_NO nvarchar(10) SET @PROJECT_NO = N'PROC_TEST' SET @DOCUMENT_ID = N'0000000000' --- 테스트를 위한 프로젝트 추가 INSERT INTO [dbo].[RUN_PROJECTS] ([PROJECT_NO] ,[PROJECT_NAME] ,[RUN_DATETIME] ,[IS_ACTIVITY]) VALUES (@PROJECT_NO ,@PROJECT_NO ,GETDATE() ,1) -- [CONVERT_INSERT_CONVERTDOC] TEST START DECLARE @return_value1 int DECLARE @DOCUMENT_URL nvarchar(50) DECLARE @NewCONVERT_ID varchar(50) SET @DOCUMENT_URL = N'HTTP://PROC_TEST' EXEC @return_value1 = [dbo].[CONVERT_INSERT_CONVERTDOC] @PROJECT_NO, @DOCUMENT_URL, @DOCUMENT_ID, @NewCONVERT_ID OUTPUT SELECT 'CONVERT_INSERT_CONVERTDOC TEST' = @NewCONVERT_ID -- [CONVERT_INSERT_CONVERTDOC] TEST END -- [CONVERT_INSERT_DOCUMENTITEM] TEST START DECLARE @REVISION nvarchar(50) DECLARE @DOCUMENT_NO nvarchar(50) DECLARE @DOCUMENT_NAME nvarchar(500) DECLARE @ORIGINAL_FILE nvarchar(500) DECLARE @Link nvarchar(500) DECLARE @RESULT_FILE nvarchar(500) DECLARE @RESULT nvarchar(50) DECLARE @GROUP_NO nvarchar(50) DECLARE @NewDOCUMENTITEM_ID nvarchar(50) SET @REVISION = N'A' SET @DOCUMENT_NO = N'PROC_TEST_DOCUMENT_NO' SET @DOCUMENT_NAME = N'PROC_TEST_DOCUMENT_NAME' SET @ORIGINAL_FILE = N'PROC_TEST_ORIGINAL_FILE' SET @Link = N'PROC_TEST_Link' SET @RESULT_FILE = N'PROC_RESULT_FILE' SET @RESULT = N'PROC_RESULT' SET @GROUP_NO = N'PROC_GROUP_NO' EXECUTE @return_value1 = [dbo].[CONVERT_INSERT_DOCUMENTITEM] @REVISION ,@DOCUMENT_NO ,@DOCUMENT_NAME ,@ORIGINAL_FILE ,@DOCUMENT_ID ,@PROJECT_NO ,@Link ,@RESULT_FILE ,@RESULT ,@GROUP_NO ,@NewDOCUMENTITEM_ID OUTPUT SELECT 'CONVERT_INSERT_DOCUMENTITEM TEST' = @NewDOCUMENTITEM_ID -- [CONVERT_INSERT_DOCUMENTITEM] TEST END -- [CONVERT_INSERT_DOCINFO] TEST START DECLARE @RC int DECLARE @CONVERTDOC_ID nvarchar(max) DECLARE @PAGE_COUNT int DECLARE @NewDOCINFO_ID varchar(50) DECLARE @ErrorCode int DECLARE @Error varchar(500) SET @CONVERTDOC_ID = @NewCONVERT_ID; SET @PAGE_COUNT = 1; EXECUTE @RC = [dbo].[CONVERT_INSERT_DOCINFO] @CONVERTDOC_ID ,@PAGE_COUNT ,@NewDOCINFO_ID OUTPUT ,@ErrorCode OUTPUT ,@Error OUTPUT SELECT 'CONVERT_INSERT_DOCINFO TEST' = @NewDOCINFO_ID -- [CONVERT_INSERT_DOCINFO] TEST END -- [TYPE_INSERT_DOCPAGE] TEST START DECLARE @DOCPAGES [dbo].[TYPE_INSERT_DOCPAGE] INSERT INTO @DOCPAGES ( [DOCINFO_ID], [PAGE_NUMBER], [PAGE_WIDTH], [PAGE_HEIGHT], [PAGE_ANGLE]) VALUES ( @NewDOCINFO_ID, 1, '1000', '1000', '0' ) EXECUTE @RC = [dbo].[CONVERT_INSERT_DOCPAGE] @DOCPAGES SELECT 'DOCPAGE_COUNT' = COUNT(*) FROM [dbo].[DOCPAGE] WHERE DOCINFO_ID = @NewDOCINFO_ID -- [TYPE_INSERT_DOCPAGE] TEST END -- [CONVERT_UPDATE_CLEANUP_ITEM] TEST START DECLARE @P_ConverterDocID nvarchar(max) DECLARE @P_ReConvert int SET @P_ConverterDocID = @NewCONVERT_ID SET @P_ReConvert = 1 EXECUTE @RC = [dbo].[CONVERT_UPDATE_CLEANUP_ITEM] @P_ConverterDocID ,@P_ReConvert SELECT 'RECONVERT CHANGE' = RECONVERTER FROM [dbo].[CONVERTER_DOC] where ID = @NewCONVERT_ID -- [CONVERT_UPDATE_CLEANUP_ITEM] TEST END -- [CONVERT_UPDATE_STATUS] TEST START DECLARE @SERVICE_ID nvarchar(max) DECLARE @ID nvarchar(max) DECLARE @STATUS int DECLARE @TOTAL_PAGE int DECLARE @CURRENT_PAGE int DECLARE @EXCEPTION nvarchar(max) SET @SERVICE_ID = 'TEST_SERVICE_ID' SET @ID = @NewCONVERT_ID SET @STATUS = 1 SET @TOTAL_PAGE = 1 SET @CURRENT_PAGE = 1 SET @EXCEPTION = N'TEST_EXCEPTION' EXECUTE @RC = [dbo].[CONVERT_UPDATE_STATUS] @SERVICE_ID ,@ID ,@STATUS ,@TOTAL_PAGE ,@CURRENT_PAGE ,@EXCEPTION SELECT 'UPDATE STATUS' = STATUS,RECONVERTER FROM CONVERTER_DOC WHERE ID = @NewCONVERT_ID -- [CONVERT_UPDATE_STATUS] TEST END -- [CONVERT_SELECT_CONVERTINGITEMS] TEST START DECLARE @P_TakeCount int SET @P_TakeCount = 10 EXECUTE @RC = [dbo].[CONVERT_SELECT_CONVERTINGITEMS] @P_TakeCount -- [CONVERT_SELECT_CONVERTINGITEMS] TEST END -- [CONVERT_SELECT_WAITorERROR] TEST START UPDATE [dbo].[CONVERTER_DOC] SET [STATUS] = 50 WHERE ID = @NewCONVERT_ID DECLARE @P_Count int set @P_Count = 1 EXECUTE @RC = [dbo].[CONVERT_SELECT_WAITorERROR] @P_Count -- [CONVERT_SELECT_WAITorERROR] TEST START END GO /****** Object: StoredProcedure [dbo].[TEST_CONVERT_PROC_ITEM_REMOVE] Script Date: 2023-05-30 오전 10:22:09 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TEST_CONVERT_PROC_ITEM_REMOVE]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[TEST_CONVERT_PROC_ITEM_REMOVE] AS' END GO --- 프로시저 테스트 후 ITEM 삭제 ALTER PROCEDURE [dbo].[TEST_CONVERT_PROC_ITEM_REMOVE] AS BEGIN SET NOCOUNT ON; DECLARE @return_value1 int DECLARE @DOCUMENT_ID nvarchar(50) DECLARE @PROJECT_NO nvarchar(10) DECLARE @DOCUMENT_URL nvarchar(50) DECLARE @CONVERT_ID varchar(50) DECLARE @DOCINFO_ID varchar(50) SET @PROJECT_NO = N'PROC_TEST' SET @DOCUMENT_ID = N'PROC_TEST_ID' SELECT @DOCINFO_ID =[ID] FROM DOCINFO WHERE DOCUMENT_ID = @DOCUMENT_ID DELETE FROM DOCPAGE WHERE DOCINFO_ID = @DOCINFO_ID DELETE FROM DOCINFO WHERE DOCUMENT_ID = @DOCUMENT_ID DELETE FROM DOCUMENT_ITEM WHERE DOCUMENT_ID = @DOCUMENT_ID DELETE FROM CONVERTER_DOC WHERE DOCUMENT_ID = @DOCUMENT_ID DELETE FROM RUN_PROJECTS WHERE PROJECT_NO = @PROJECT_NO END GO IF NOT EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane1' , N'SCHEMA',N'dbo', N'VIEW',N'ViewMarkupData', NULL,NULL)) EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00] Begin DesignProperties = Begin PaneConfigurations = Begin PaneConfiguration = 0 NumPanes = 4 Configuration = "(H (1[42] 4[16] 2[18] 3) )" End Begin PaneConfiguration = 1 NumPanes = 3 Configuration = "(H (1 [50] 4 [25] 3))" End Begin PaneConfiguration = 2 NumPanes = 3 Configuration = "(H (1 [50] 2 [25] 3))" End Begin PaneConfiguration = 3 NumPanes = 3 Configuration = "(H (4 [30] 2 [40] 3))" End Begin PaneConfiguration = 4 NumPanes = 2 Configuration = "(H (1 [56] 3))" End Begin PaneConfiguration = 5 NumPanes = 2 Configuration = "(H (2 [66] 3))" End Begin PaneConfiguration = 6 NumPanes = 2 Configuration = "(H (4 [50] 3))" End Begin PaneConfiguration = 7 NumPanes = 1 Configuration = "(V (3))" End Begin PaneConfiguration = 8 NumPanes = 3 Configuration = "(H (1[56] 4[18] 2) )" End Begin PaneConfiguration = 9 NumPanes = 2 Configuration = "(H (1 [75] 4))" End Begin PaneConfiguration = 10 NumPanes = 2 Configuration = "(H (1[66] 2) )" End Begin PaneConfiguration = 11 NumPanes = 2 Configuration = "(H (4 [60] 2))" End Begin PaneConfiguration = 12 NumPanes = 1 Configuration = "(H (1) )" End Begin PaneConfiguration = 13 NumPanes = 1 Configuration = "(V (4))" End Begin PaneConfiguration = 14 NumPanes = 1 Configuration = "(V (2))" End ActivePaneConfig = 0 End Begin DiagramPane = Begin Origin = Top = 0 Left = 0 End Begin Tables = Begin Table = "MARKUP_DATA" Begin Extent = Top = 3 Left = 667 Bottom = 204 Right = 902 End DisplayFlags = 280 TopColumn = 0 End Begin Table = "ControlType" Begin Extent = Top = 14 Left = 933 Bottom = 204 Right = 1079 End DisplayFlags = 280 TopColumn = 0 End Begin Table = "DOCINFO" Begin Extent = Top = 49 Left = 25 Bottom = 219 Right = 200 End DisplayFlags = 280 TopColumn = 0 End Begin Table = "MARKUP_INFO" Begin Extent = Top = 15 Left = 218 Bottom = 232 Right = 424 End DisplayFlags = 280 TopColumn = 0 End Begin Table = "MARKUP_INFO_VERSION" Begin Extent = Top = 13 Left = 465 Bottom = 193 Right = 605 End DisplayFlags = 280 TopColumn = 0 End Begin Table = "MEMBER" Begin Extent = Top = 137 Left = 433 Bottom = 341 Right = 638 End DisplayFlags = 280 TopColumn = 1 End End End Begin SQLPane = End Begin DataPane = Begin ParameterDefaults = "" End Begin ColumnWidths = 12 Width = 284 Width = 3570 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ViewMarkupData' GO IF NOT EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPane2' , N'SCHEMA',N'dbo', N'VIEW',N'ViewMarkupData', NULL,NULL)) EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N' Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 Width = 1500 End End Begin CriteriaPane = Begin ColumnWidths = 11 Column = 1440 Alias = 900 Table = 1170 Output = 720 Append = 1400 NewValue = 1170 SortType = 1350 SortOrder = 1410 GroupBy = 1350 Filter = 1350 Or = 1350 Or = 1350 Or = 1350 End End End ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ViewMarkupData' GO IF NOT EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'MS_DiagramPaneCount' , N'SCHEMA',N'dbo', N'VIEW',N'ViewMarkupData', NULL,NULL)) EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'ViewMarkupData' GO INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArcArrow',8,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArcLine',7,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowLine',2,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowMultiLine',9,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTextBorderControl',19,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTextCloudControl',21,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTextControl',17,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTransTextBorderControl',20,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTransTextCloudControl',22,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ArrowTransTextControl',18,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('CancelLine',3,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ChainLine',6,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Circle',12,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ClipWhite',35,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Coordinate',36,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Date',27,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('DimLine',5,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('ImgControl',26,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Ink',32,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('InsideWhite',33,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Mark',30,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('None',0,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('OverlapWhite',34,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('PenControl',25,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('PolygonCloud',24,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('PolygonControl',23,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Rectangle',10,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('RectCloud',11,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Sign',28,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('SingleLine',1,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Stamp',31,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Symbol',29,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('TextBorder',15,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('TextCloud',16,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('TextControl',14,1) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('Triangle',13,0) INSERT INTO [dbo].[ControlType] ([TypeName],[TypeValue],[IsText]) VALUES ('TwinLine',4,0)