Select * From tbl_lab_setup_Test Where Test_Code='SP0000'
go
Insert Into tbl_lab_setup_Test(Test_Code,Test_Group_Code,Test_Seq,Test_Name,Test_Display_Name,Test_Display_Name_Hide_Print_Flag,Test_Type_Code,Test_Order_Status_Flag,Test_Data_Type_Code,Specimen_Type_Code,Test_His_Code,Test_Checkup_Code,Test_Send_Out_Flag,Test_Preliminary_Enable_Flag,Test_Inactive,Test_Method_Code,Test_Profile_Option_Flag,Test_Checkup_Flag,Test_Profile_Option_Share_Code_Flag) Values('SP0000','OL','',N'SPECIAL TEST',N'SPECIAL TE','0','0','1','02','29','XXX','','0','0','0','','0','0','0')
go
Insert tbl_lab_setup_log_Test(Test_Code,Test_Group_Code,Test_Seq,Test_Name,Test_Display_Name,Test_Display_Name_Hide_Print_Flag,Test_Type_Code,Test_Order_Status_Flag,Test_Data_Type_Code,Specimen_Type_Code,Test_His_Code,Test_Checkup_Code,Test_Send_Out_Flag,Test_Preliminary_Enable_Flag,Test_Inactive,Test_Method_Code,Test_Profile_Option_Flag,Test_Checkup_Flag,Test_Profile_Option_Share_Code_Flag,Test_Trx_By) Values('SP0000','OL','',N'SPECIAL TEST',N'SPECIAL TE','0','0','1','02','29','XXX','','0','0','0','','0','0','0','admin')
go
Insert Into tbl_lab_setup_Test_Control(Test_Code,Test_Auto_Test_Comment,Test_Auto_Result_Text,Test_Send_HIS_Text,Test_Default_Value_Text,Test_TAT_R_Days,Test_TAT_R_Hours,Test_TAT_R_Minutes,Test_TAT_S_Days,Test_TAT_S_Hours,Test_TAT_S_Minutes,Comment_Type_Code,Test_Share_Code_Flag,Test_Default_Value_Flag,Test_Comment_Type_Flag,Test_Send_HIS_Flag,Test_Limit_Result_Access_Flag,Test_Blind_Result_Display_Flag,Test_Auto_Result_Flag,Test_Scan_File_Flag,Test_Text_Keyin_Flag,Test_Text_Column_Print_Flag,Test_Critical_Flag,Test_Blank_Result_Flag,Test_Sp_Barcode_Flag,Test_Routine_Flag,Test_Ref_Text_Flag,Test_Ref_Text_Value,Test_Countable,Test_Package_Flag,Test_Package_Price,Test_Blind_Result_Display_Authen_Flag,Test_Pending_Time_Flag,Test_Pending_Time_Day,Test_Pending_Time_Hours,Test_Pending_Time_Miniutes,Test_Report_Flag,Test_Report,Test_Block_Result,Test_Block_Result_Flag,Test_Barcode_Copy_Flag,Test_Barcode_Copy,Test_Cost,Test_OutLab_Flag,Test_OutLab_Code,Test_Result_Equal_Pre1_Flag,Test_Click_Formula_Flag,Test_Blood_Group_Color,Test_OutLab_Specimen_Code,Test_Report_Show_Dialog_Print_On_App) Values('SP0000',N'',N'',N'',N'รอผล 5-7 วันทำการ','0','00','00','0','00','00','000','0','1','0','0','0','0','0','0','1','0','0','1','0','0','0',N'','1','0','0.00','0','0','0','00','00','0',N'',N'','0','0','','0.00','0','000000','0','0','0','','0')
go
Insert Into tbl_lab_setup_Test_Result_Short_Text(Test_Code,Short_Text_Result_Code,Test_Abnormal_Flag,Test_Alert_Flag,Not_Show_Flag,Short_Text_Seq) Values('SP0000','212','0','0','0','001')
go
---INSERT:แบบshort tesxtTESTCODE:ST0000
---1
---Insert Into tbl_lab_setup_Test(Test_Code,Test_Group_Code,Test_Seq,Test_Name,Test_Display_Name,Test_Display_Name_Hide_Print_Flag,Test_Type_Code,Test_Order_Status_Flag,Test_Data_Type_Code,Specimen_Type_Code,Test_His_Code,Test_Checkup_Code,Test_Send_Out_Flag,Test_Preliminary_Enable_Flag,Test_Inactive,Test_Method_Code,Test_Profile_Option_Flag,Test_Checkup_Flag,Test_Profile_Option_Share_Code_Flag)
---Values('SP0000','OL','',N'SPECIAL TEST',N'SPECIAL TE','0','0','1','02','29','XXX','','0','0','0','','0','0','0')
/*
### สรุปตารางที่ถูกกระทำ:
จากสคริปต์ที่ให้มา มีการกระทำกับตารางดังต่อไปนี้:
1. `tbl_lab_setup_Test`
2. `tbl_lab_setup_log_Test`
3. `tbl_lab_setup_Test_Control`
4. `tbl_lab_setup_Test_Result_Short_Text`
### อธิบายสคริปต์ที่ทำหน้าที่ต่อไปนี้:
1. **Select Statement**:
```sql
Select * From tbl_lab_setup_Test Where Test_Code='SP0000'
```
- ทำการเลือกทุกคอลัมน์จากตาราง `tbl_lab_setup_Test` ที่มี `Test_Code` เป็น 'SP0000'
2. **Insert Statement 1**:
```sql
Insert Into tbl_lab_setup_Test(Test_Code,Test_Group_Code,Test_Seq,Test_Name,Test_Display_Name,Test_Display_Name_Hide_Print_Flag,Test_Type_Code,Test_Order_Status_Flag,Test_Data_Type_Code,Specimen_Type_Code,Test_His_Code,Test_Checkup_Code,Test_Send_Out_Flag,Test_Preliminary_Enable_Flag,Test_Inactive,Test_Method_Code,Test_Profile_Option_Flag,Test_Checkup_Flag,Test_Profile_Option_Share_Code_Flag)
Values('SP0000','OL','',N'SPECIAL TEST',N'SPECIAL TE','0','0','1','02','29','XXX','','0','0','0','','0','0','0')
```
- ทำการแทรกแถวใหม่เข้าไปในตาราง `tbl_lab_setup_Test` โดยมีค่าตามที่ระบุใน `Values`
3. **Insert Statement 2**:
```sql
Insert tbl_lab_setup_log_Test(Test_Code,Test_Group_Code,Test_Seq,Test_Name,Test_Display_Name,Test_Display_Name_Hide_Print_Flag,Test_Type_Code,Test_Order_Status_Flag,Test_Data_Type_Code,Specimen_Type_Code,Test_His_Code,Test_Checkup_Code,Test_Send_Out_Flag,Test_Preliminary_Enable_Flag,Test_Inactive,Test_Method_Code,Test_Profile_Option_Flag,Test_Checkup_Flag,Test_Profile_Option_Share_Code_Flag,Test_Trx_By)
Values('SP0000','OL','',N'SPECIAL TEST',N'SPECIAL TE','0','0','1','02','29','XXX','','0','0','0','','0','0','0','admin')
```
- ทำการแทรกแถวใหม่เข้าไปในตาราง `tbl_lab_setup_log_Test` โดยมีค่าตามที่ระบุใน `Values` และเพิ่ม `Test_Trx_By` ซึ่งบ่งบอกว่าแทรกโดย 'admin'
4. **Insert Statement 3**:
```sql
Insert Into tbl_lab_setup_Test_Control(Test_Code,Test_Auto_Test_Comment,Test_Auto_Result_Text,Test_Send_HIS_Text,Test_Default_Value_Text,Test_TAT_R_Days,Test_TAT_R_Hours,Test_TAT_R_Minutes,Test_TAT_S_Days,Test_TAT_S_Hours,Test_TAT_S_Minutes,Comment_Type_Code,Test_Share_Code_Flag,Test_Default_Value_Flag,Test_Comment_Type_Flag,Test_Send_HIS_Flag,Test_Limit_Result_Access_Flag,Test_Blind_Result_Display_Flag,Test_Auto_Result_Flag,Test_Scan_File_Flag,Test_Text_Keyin_Flag,Test_Text_Column_Print_Flag,Test_Critical_Flag,Test_Blank_Result_Flag,Test_Sp_Barcode_Flag,Test_Routine_Flag,Test_Ref_Text_Flag,Test_Ref_Text_Value,Test_Countable,Test_Package_Flag,Test_Package_Price,Test_Blind_Result_Display_Authen_Flag,Test_Pending_Time_Flag,Test_Pending_Time_Day,Test_Pending_Time_Hours,Test_Pending_Time_Miniutes,Test_Report_Flag,Test_Report,Test_Block_Result,Test_Block_Result_Flag,Test_Barcode_Copy_Flag,Test_Barcode_Copy,Test_Cost,Test_OutLab_Flag,Test_OutLab_Code,Test_Result_Equal_Pre1_Flag,Test_Click_Formula_Flag,Test_Blood_Group_Color,Test_OutLab_Specimen_Code,Test_Report_Show_Dialog_Print_On_App)
Values('SP0000',N'',N'',N'',N'รอผล 5-7 วันทำการ','0','00','00','0','00','00','000','0','1','0','0','0','0','0','0','1','0','0','1','0','0','0',N'','1','0','0.00','0','0','0','00','00','0',N'',N'','0','0','','0.00','0','000000','0','0','0','','0')
```
- ทำการแทรกแถวใหม่เข้าไปในตาราง `tbl_lab_setup_Test_Control` โดยมีค่าตามที่ระบุใน `Values`
5. **Insert Statement 4**:
```sql
Insert Into tbl_lab_setup_Test_Result_Short_Text(Test_Code,Short_Text_Result_Code,Test_Abnormal_Flag,Test_Alert_Flag,Not_Show_Flag,Short_Text_Seq)
Values('SP0000','212','0','0','0','001')
```
- ทำการแทรกแถวใหม่เข้าไปในตาราง `tbl_lab_setup_Test_Result_Short_Text` โดยมีค่าตามที่ระบุใน `Values`
### สรุป
สคริปต์เหล่านี้มีการกระทำหลัก ๆ คือการแทรกข้อมูลใหม่เข้าไปในหลายตารางของระบบฐานข้อมูลที่เกี่ยวข้องกับการตั้งค่าทดสอบทางห้องปฏิบัติการ:
- `tbl_lab_setup_Test` เก็บข้อมูลการตั้งค่าทดสอบ
- `tbl_lab_setup_log_Test` เก็บข้อมูลบันทึกการตั้งค่าทดสอบ
- `tbl_lab_setup_Test_Control` เก็บข้อมูลการควบคุมทดสอบ
- `tbl_lab_setup_Test_Result_Short_Text` เก็บข้อความผลลัพธ์ทดสอบแบบสั้น
การทำเช่นนี้ช่วยให้มั่นใจได้ว่าข้อมูลการทดสอบจะถูกบันทึกและจัดการในหลายมุมมองของระบบฐานข้อมูลเพื่อการใช้งานที่หลากหลาย
*/
To embed this project on your website, copy the following code and paste it into your website's HTML: