USE [master]
GO
/****** Object:  Database [cmod_qc]    Script Date: 17/01/2026 18:26:32 ******/
CREATE DATABASE [cmod_qc]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'cmod_qc', FILENAME = N'C:\db\cmod_qc.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'cmod_qc_log', FILENAME = N'C:\db\cmod_qc_log.ldf' , SIZE = 32448KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
 WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF
GO
ALTER DATABASE [cmod_qc] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [cmod_qc].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [cmod_qc] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [cmod_qc] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [cmod_qc] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [cmod_qc] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [cmod_qc] SET ARITHABORT OFF 
GO
ALTER DATABASE [cmod_qc] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [cmod_qc] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [cmod_qc] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [cmod_qc] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [cmod_qc] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [cmod_qc] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [cmod_qc] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [cmod_qc] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [cmod_qc] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [cmod_qc] SET  DISABLE_BROKER 
GO
ALTER DATABASE [cmod_qc] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [cmod_qc] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [cmod_qc] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [cmod_qc] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [cmod_qc] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [cmod_qc] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [cmod_qc] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [cmod_qc] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [cmod_qc] SET  MULTI_USER 
GO
ALTER DATABASE [cmod_qc] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [cmod_qc] SET DB_CHAINING OFF 
GO
ALTER DATABASE [cmod_qc] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [cmod_qc] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
ALTER DATABASE [cmod_qc] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [cmod_qc] SET ACCELERATED_DATABASE_RECOVERY = OFF  
GO
ALTER DATABASE [cmod_qc] SET QUERY_STORE = OFF
GO
USE [cmod_qc]
GO
/****** Object:  Table [dbo].[CONTROL_TEST]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CONTROL_TEST](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[controlid] [int] NULL,
	[testid] [int] NULL,
	[mean] [float] NULL,
	[sd] [float] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DAILY_RESULT]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DAILY_RESULT](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[controlid] [int] NULL,
	[testid] [int] NULL,
	[resdate] [datetime] NULL,
	[resvalue] [varchar](50) NULL,
	[rescomment] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DICT_CONTROL]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_CONTROL](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[deptid] [int] NULL,
	[name] [varchar](50) NULL,
	[lot] [varchar](50) NULL,
	[producer] [text] NULL,
	[expdate] [date] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DICT_DEPT]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_DEPT](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[name] [varchar](50) NULL,
 CONSTRAINT [PK_DICT_DEPT] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DICT_TEST]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_TEST](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[deptid] [int] NULL,
	[name] [varchar](50) NULL,
	[unit] [varchar](50) NULL,
	[method] [varchar](50) NULL,
	[cva] [varchar](50) NULL,
	[ba] [varchar](50) NULL,
	[tea] [varchar](50) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[MONTHLY_COMMENT]    Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MONTHLY_COMMENT](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[controlid] [int] NOT NULL,
	[testid] [int] NOT NULL,
	[commonth] [varchar](7) NOT NULL,
	[comtext] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
USE [master]
GO
ALTER DATABASE [cmod_qc] SET  READ_WRITE 
GO
