Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help with cloning a record by a moron

Author  Topic 

JerkofallTrades
Starting Member

5 Posts

Posted - 2008-04-28 : 16:13:57
Greetings All,

I'm trying to do something that's probably a bit on the stupid side. I've inherited a SCADA system that tracks information on pipe sections manufactured within our mill. It is SQLServer 2000, encapsulated within Siemens WinCC Flexible. My SQL knowledge is less than zero.

We record and make pipe information accessible using a table called Pipe_Serial. It is organized more like a flat file than anything else, and is something over 530 columns. (Yes I know it poor, we will be redesigning it in the near future)

But in the meanwhile, I need to be able to copy a single record, change the primary key (also known as Pipe_Serial) and then insert it back into the table. This function mirrors the planned act of cutting a 80' pipe (a mother pipe, serial # 06L3W0999 for example) into 2 40' daughter pipes. (06L3W0999A and 06L3W0999B) We then set the status of the mother pipe to finished, and allow the two daughter pipes to continue processing with their own transaction records.

I have tried many variations of INSERT SELECT, but haven't been able to make it work. I've recently been trying to do a SELECT INTO to create a temp table (without having to define 530 columns) but that's been going nowhere either. Below is what I'm doing in SQL Analyzer, and the result:

Select * Into #temp1 From Pipe_Serial Where Pipe_Serial = '06L3W0999'
Update #temp1 Set Pipe_Serial = '06L3W0999A'
Insert Into Pipe_Serial Select * from #temp1


Server: Msg 213, Level 16, State 4, Line 3
Insert Error: Column name or number of supplied values does not match table definition.

Any suggestions on how to get this to work, or another method to do a single record copy with changed primary key?

Thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 16:19:44
Here's an example:

INSERT INTO YourTable(Column1, Column2, Column3)
SELECT 99, Column2, Column3
FROM YourTable
WHERE Column1 = 22

So I'm grabbing record 22 from the table and then inserting it as record 99 with the rest of the values from 22.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

JerkofallTrades
Starting Member

5 Posts

Posted - 2008-04-28 : 16:23:46
That looks good, but do I have to define all 530 columns in the record?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 16:29:30
Yes. You can easily script it out though in Query Analyzer by navigating to the object and selecting the appropriate option.

You can also get the column list via:
SELECT COLUMN_NAME + ', '
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YourTable'

And then remove the last comma.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

JerkofallTrades
Starting Member

5 Posts

Posted - 2008-04-28 : 16:46:59
Well, that seems to do it for defining the columns, but now I get an error:

Server: Msg 510, Level 16, State 2, Line 1
Cannot create a worktable row larger than allowable maximum. Resubmit your query with the ROBUST PLAN hint.

When I add OPTION (ROBUST PLAN) at the bottom of the query I get:

Server 8619, Level 16, State 2, Line 1
Warning: The query processor could not produce a query plan from the optimizer becuase the total length of all the columns in the GROUP BY or ORDER BY clause exceeds 8000 bytes. Resubmit your query without the ROBUST PLAN hint.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 17:31:53
You should post the query that you tried that got the ROBUST PLAN error. I can't imagine needing to add that.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

JerkofallTrades
Starting Member

5 Posts

Posted - 2008-04-28 : 17:40:14
With apologies:

Insert Into Pipe_Serial(Pipe_Serial,
Auto_Hold,
Badge_Number,
FI_Def_RG3,
FI_Def_RG4,
FI_Def_RG5,
FI_Def_RG6,
FI_Def1,
FI_Def2,
FI_Def3,
FI_Def4,
FI_Def5,
FI_Def6,
FI_Dis1,
FI_Dis2,
FI_Dis3,
FI_Dis4,
FI_Dis5,
FI_Dis6,
FI_End_CutH,
FI_End_CutT,
FI_End_RG1,
FI_End_RG2,
FI_End_RG3,
FI_End_RG4,
FI_End_RG5,
FI_End_RG6,
FI_End1,
FI_End2,
FI_End3,
FI_End4,
FI_End5,
FI_End6,
FI_Image_CutH,
FI_Image_CutT,
FI_Image_RG1,
FI_Image_RG2,
FI_Image_RG3,
FI_Image_RG4,
FI_Image_RG5,
FI_Image_RG6,
FI_Loc,
FI_Loc_CutH,
FI_Loc_CutT,
FI_Loc_Gnd1,
FI_Loc_Gnd2,
FI_Loc_Gnd3,
FI_Loc_Gnd4,
FI_Loc_Gnd5,
FI_Loc_Gnd6,
FI_Loc_Rep1,
FI_Loc_Rep2,
FI_Loc_Rep3,
FI_Loc_Rep4,
FI_Loc_Rep5,
FI_Loc_Rep6,
FI_Loc1,
FI_Loc2,
FI_Loc3,
FI_Loc4,
FI_Loc5,
FI_Loc6,
FI_Rml1,
FI_Rml2,
FI_Rml3,
FI_Rml4,
FI_Rml5,
FI_Rml6,
Final_Ins_Fail_Bool,
Final_Ins_Pass_Bool,
Final_Insp_Op,
Final_Insp_WS_Time,
Final_Inspection_PF,
Final_Prove_Fail_Bool,
Final_Prove_Op,
Final_Prove_Pass_Bool,
Final_Prove_PF,
Final_Prove_WS_Time,
Final_UT_Alarm_Loc_1,
Final_UT_Alarm_Loc_2,
Final_UT_Alarm_Loc_3,
Final_UT_Alarm_Loc_4,
Final_UT_Alarm_Loc_5,
Final_UT_Alarm_Loc_6,
Final_UT_Alarm_Loc_7,
Final_UT_Alarm_Loc_8,
Final_UT_Body_A_Bool,
Final_UT_Body_F_Bool,
Final_UT_Body_N_Bool,
Final_UT_Body_P_Bool,
Final_UT_Body_PF,
Final_UT_BodyTestCrit,
Final_UT_Chan_Def_1,
Final_UT_Chan_Def_2,
Final_UT_Chan_Def_3,
Final_UT_Chan_Def_4,
Final_UT_Chan_Def_5,
Final_UT_Chan_Def_6,
Final_UT_Chan_Def_7,
Final_UT_Chan_Def_8,
Final_UT_Channel_1,
Final_UT_Channel_2,
Final_UT_Channel_3,
Final_UT_Channel_4,
Final_UT_Channel_5,
Final_UT_Channel_6,
Final_UT_Channel_7,
Final_UT_Channel_8,
Final_UT_Comment_1,
Final_UT_Comment_2,
Final_UT_Comment_3,
Final_UT_Comment_4,
Final_UT_Comment_5,
Final_UT_Comment_6,
Final_UT_Comment_7,
Final_UT_Comment_8,
Final_UT_Inspection_Alert,
Final_UT_Op,
Final_UT_Times_Through,
Final_UT_Weld_A_Bool,
Final_UT_Weld_F_Bool,
Final_UT_Weld_N_Bool,
Final_UT_Weld_P_Bool,
Final_UT_Weld_PF,
Final_UT_Weld_Retest,
Final_UT_WeldTestCrit,
Final_UT_WS_Time,
Gauge,
Heat_Nr,
Hydro_Fail_Bool,
Hydro_Hold_Bool,
Hydro_Inspection_Alert,
Hydro_No_Test_Bool,
Hydro_Op,
Hydro_Pass_A252_Bool,
Hydro_Pass_API_Bool,
Hydro_Pass_Bool,
Hydro_Pass_Test_Bool,
Hydro_PF,
Hydro_WS_Pres,
Hydro_WS_Time,
Job_Number,
Length_Fail_Bool,
Length_Pass_Bool,
M_U_T_Alarm_1,
M_U_T_Alarm_2,
M_U_T_Alarm_3,
M_U_T_Alarm_4,
M_U_T_Alarm_5,
M_U_T_Alarm_6,
M_U_T_Alarm_7,
M_U_T_Alarm_8,
M_U_T_Alarm_Com_1,
M_U_T_Alarm_Com_2,
M_U_T_Alarm_Com_3,
M_U_T_Alarm_Com_4,
M_U_T_Alarm_Com_5,
M_U_T_Alarm_Com_6,
M_U_T_Alarm_Com_7,
M_U_T_Alarm_Com_8,
M_U_T_Alarm_Def_1,
M_U_T_Alarm_Def_2,
M_U_T_Alarm_Def_3,
M_U_T_Alarm_Def_4,
M_U_T_Alarm_Def_5,
M_U_T_Alarm_Def_6,
M_U_T_Alarm_Def_7,
M_U_T_Alarm_Def_8,
M_U_T_Alarm_Loc_1,
M_U_T_Alarm_Loc_2,
M_U_T_Alarm_Loc_3,
M_U_T_Alarm_Loc_4,
M_U_T_Alarm_Loc_5,
M_U_T_Alarm_Loc_6,
M_U_T_Alarm_Loc_7,
M_U_T_Alarm_Loc_8,
M_U_T_Inspection_Alert,
M_U_T_Op,
M_U_T_PF,
M_U_T_PF_Bool,
M_U_T_WS_Time,
Mark_PT,
Mark_WS_Time,
Marking_Op,
Mill_Control_Alarm_1,
Mill_Control_Alarm_1_2,
Mill_Control_Alarm_2,
Mill_Control_Alarm_2_2,
Mill_Control_Alarm_3,
Mill_Control_Alarm_3_2,
Mill_Control_Alarm_4,
Mill_Control_Alarm_4_2,
Mill_Control_Alarm_5,
Mill_Control_Alarm_5_2,
Mill_Control_Alarm_6,
Mill_Control_Alarm_6_2,
No_Test_Bool,
NoTest_SW_East_Bool,
NoTest_SW_West_Bool,
OD,
OD_Mark_Op,
OD_Mark_PT,
OD_Mark_WS_Time,
Order_Grade,
Pass_Bool,
Pass_SB_East_Bool,
Pass_SB_West_Bool,
Pass_SW_East_Bool,
Pass_SW_West_Bool,
Pipe_CO_Inspection_Alert,
Pipe_Length,
Pipe_Length_PF,
Pipe_Status,
Pipe_Weight_PF,
Pre_Ins_Fail_Bool,
Pre_Ins_Pass_Bool,
Pre_Insp_Op,
Pre_Insp_WS_Time,
Pre_Inspection_PF,
Prove_F_Alm_Cut,
Prove_F_Alm_RG1,
Prove_F_Alm_RG2,
Prove_F_Alm_RG3,
Prove_F_Alm_RG4,
Prove_F_Alm_RG5,
Prove_F_Alm_RG6,
Prove_F_Def_Cut,
Prove_F_Def_RG1,
Prove_F_Def_RG2,
Prove_F_Def_RG3,
Prove_F_Def_RG4,
Prove_F_Def_RG5,
Prove_F_Def_RG6,
Prove_F_Loc_Cut,
Prove_F_Loc_Gnd1,
Prove_F_Loc_Gnd2,
Prove_F_Loc_Gnd3,
Prove_F_Loc_Gnd4,
Prove_F_Loc_Gnd5,
Prove_F_Loc_Gnd6,
Prove_F_Loc_Rep1,
Prove_F_Loc_Rep2,
Prove_F_Loc_Rep3,
Prove_F_Loc_Rep4,
Prove_F_Loc_Rep5,
Prove_F_Loc_Rep6,
Prove_Fail_Bool,
Prove_M_Alm_Cut1,
Prove_M_Alm_Cut2,
Prove_M_Alm_Cut3,
Prove_M_Alm_Cut4,
Prove_M_Alm_Cut5,
Prove_M_Alm_Cut6,
Prove_M_Alm_Cut7,
Prove_M_Alm_Cut8,
Prove_M_Alm_RG1,
Prove_M_Alm_RG2,
Prove_M_Alm_RG3,
Prove_M_Alm_RG4,
Prove_M_Alm_RG5,
Prove_M_Alm_RG6,
Prove_M_Alm_RG7,
Prove_M_Alm_RG8,
Prove_M_Def_Cut1,
Prove_M_Def_Cut2,
Prove_M_Def_Cut3,
Prove_M_Def_Cut4,
Prove_M_Def_Cut5,
Prove_M_Def_Cut6,
Prove_M_Def_Cut7,
Prove_M_Def_Cut8,
Prove_M_Def_RG1,
Prove_M_Def_RG2,
Prove_M_Def_RG3,
Prove_M_Def_RG4,
Prove_M_Def_RG5,
Prove_M_Def_RG6,
Prove_M_Def_RG7,
Prove_M_Def_RG8,
Prove_M_Loc_Cut1,
Prove_M_Loc_Cut2,
Prove_M_Loc_Cut3,
Prove_M_Loc_Cut4,
Prove_M_Loc_Cut5,
Prove_M_Loc_Cut6,
Prove_M_Loc_Cut7,
Prove_M_Loc_Cut8,
Prove_M_Loc_Gnd1,
Prove_M_Loc_Gnd2,
Prove_M_Loc_Gnd3,
Prove_M_Loc_Gnd4,
Prove_M_Loc_Gnd5,
Prove_M_Loc_Gnd6,
Prove_M_Loc_Gnd7,
Prove_M_Loc_Gnd8,
Prove_M_Loc_Rep1,
Prove_M_Loc_Rep2,
Prove_M_Loc_Rep3,
Prove_M_Loc_Rep4,
Prove_M_Loc_Rep5,
Prove_M_Loc_Rep6,
Prove_M_Loc_Rep7,
Prove_M_Loc_Rep8,
Prove_Op,
Prove_Pass_Bool,
Prove_PF,
Prove_Up_Inspection_Alert,
Prove_WS_Time,
Recheck_Integ,
Rehydro,
Rework_Pipe_Inspection_Alert,
RTR_Alarm_Drawing_1,
RTR_Alarm_Drawing_1_2,
RTR_Alarm_Drawing_2,
RTR_Alarm_Drawing_2_2,
RTR_Alarm_Drawing_3,
RTR_Alarm_Drawing_3_2,
RTR_Alarm_Drawing_4,
RTR_Alarm_Drawing_4_2,
RTR_Alarm_Drawing_5,
RTR_Alarm_Drawing_5_2,
RTR_Alarm_Drawing_6,
RTR_Alarm_Drawing_6_2,
RTR_Alm_CutH,
RTR_Alm_CutT,
RTR_Alm_RG1,
RTR_Alm_RG2,
RTR_Alm_RG3,
RTR_Alm_RG4,
RTR_Alm_RG5,
RTR_Alm_RG6,
RTR_Comment_Image_1,
RTR_Comment_Image_2,
RTR_Comment_Image_3,
RTR_Comment_Image_4,
RTR_Comment_Image_5,
RTR_Comment_Image_6,
RTR_Def_CutH,
RTR_Def_CutT,
RTR_Def_RG1,
RTR_Def_RG2,
RTR_Def_RG3,
RTR_Def_RG4,
RTR_Def_RG5,
RTR_Def_RG6,
RTR_Defect_1,
RTR_Defect_2,
RTR_Defect_3,
RTR_Defect_4,
RTR_Defect_5,
RTR_Defect_6,
RTR_Defect_Def_1,
RTR_Defect_Def_2,
RTR_Defect_Def_3,
RTR_Defect_Def_4,
RTR_Defect_Def_5,
RTR_Defect_Def_6,
RTR_Disp_1,
RTR_Disp_2,
RTR_Disp_3,
RTR_Disp_4,
RTR_Disp_5,
RTR_Disp_6,
RTR_E_Op,
RTR_E_PF,
RTR_E_WS_Time,
RTR_East_Bool,
RTR_East_PF,
RTR_EastTestCrit,
RTR_End_CutH,
RTR_End_CutT,
RTR_End_RG1,
RTR_End_RG2,
RTR_End_RG3,
RTR_End_RG4,
RTR_End_RG5,
RTR_End_RG6,
RTR_EW_PF,
RTR_Grind_Location_1,
RTR_Grind_Location_2,
RTR_Grind_Location_3,
RTR_Grind_Location_4,
RTR_Grind_Location_5,
RTR_Grind_Location_6,
RTR_Image_CutH,
RTR_Image_CutT,
RTR_Image_Req_1,
RTR_Image_Req_2,
RTR_Image_Req_3,
RTR_Image_Req_4,
RTR_Image_Req_5,
RTR_Image_Req_6,
RTR_Image_RG1,
RTR_Image_RG2,
RTR_Image_RG3,
RTR_Image_RG4,
RTR_Image_RG5,
RTR_Image_RG6,
RTR_Loc_CutH,
RTR_Loc_CutT,
RTR_Loc_Gnd1,
RTR_Loc_Gnd2,
RTR_Loc_Gnd3,
RTR_Loc_Gnd4,
RTR_Loc_Gnd5,
RTR_Loc_Gnd6,
RTR_Loc_Rep1,
RTR_Loc_Rep2,
RTR_Loc_Rep3,
RTR_Loc_Rep4,
RTR_Loc_Rep5,
RTR_Loc_Rep6,
RTR_PF,
RTR_Pipe_End_1,
RTR_Pipe_End_2,
RTR_Pipe_End_3,
RTR_Pipe_End_4,
RTR_Pipe_End_5,
RTR_Pipe_End_6,
RTR_Repair_Loc_1,
RTR_Repair_Loc_2,
RTR_Repair_Loc_3,
RTR_Repair_Loc_4,
RTR_Repair_Loc_5,
RTR_Repair_Loc_6,
RTR_W_Op,
RTR_West_Bool,
RTR_West_PF,
RTR_WestTestCrit,
RTR_WS_Time,
SB_East_PF,
SB_West_PF,
Secondary_Downgrade_Reason,
Sequence_Check,
Springback,
SW_East_PF,
SW_West_PF,
Test_Pipe,
Throwaway,
Time_Cut,
UT_Pipe_Ends_Comment_1,
UT_Pipe_Ends_Comment_2,
UT_Pipe_Ends_Comment_3,
UT_Pipe_Ends_Cut_L_1,
UT_Pipe_Ends_Cut_L_2,
UT_Pipe_Ends_Cut_L_3,
UT_Pipe_Ends_Defect_Code_1,
UT_Pipe_Ends_Defect_Code_2,
UT_Pipe_Ends_Defect_Code_3,
UT_Pipe_Ends_Definition_1,
UT_Pipe_Ends_Definition_2,
UT_Pipe_Ends_Definition_3,
UT_Pipe_Ends_East_PF,
UT_Pipe_Ends_End_1,
UT_Pipe_Ends_End_2,
UT_Pipe_Ends_End_3,
UT_Pipe_Ends_Inspection_Alert,
UT_Pipe_Ends_SB_SW_Fail_1,
UT_Pipe_Ends_SB_SW_Fail_2,
UT_Pipe_Ends_SB_SW_Fail_3,
UT_Pipe_Ends_West_PF,
W_EndUT_Op,
W_EndUT_WS_Time,
W_EndXray_WS_Time,
W_Xray_Op,
Weigh_and_M_PF,
Weigh_Op,
Weigh_WS_Time,
Weight_Fail_Bool,
Weight_Pass_Bool,
Weld_Rep_Inspection_Alert,
Weld_Rep_Op,
Weld_Rep_PT,
Weld_Rep_WS_Time,
West_Xray_A252_Bool,
West_Xray_API_Bool,
West_Xray_Fail_Bool,
West_Xray_Pass_Bool,
West_Xray_PF,
West_XrayTestCrit,
WUT_Pipe_Ends_Comment_1,
WUT_Pipe_Ends_Comment_2,
WUT_Pipe_Ends_Comment_3,
WUT_Pipe_Ends_Cut_L_1,
WUT_Pipe_Ends_Cut_L_2,
WUT_Pipe_Ends_Cut_L_3,
WUT_Pipe_Ends_Defect_Code_1,
WUT_Pipe_Ends_Defect_Code_2,
WUT_Pipe_Ends_Defect_Code_3,
WUT_Pipe_Ends_Definition_1,
WUT_Pipe_Ends_Definition_2,
WUT_Pipe_Ends_Definition_3,
WUT_Pipe_Ends_End_1,
WUT_Pipe_Ends_End_2,
WUT_Pipe_Ends_End_3,
WUT_Pipe_Ends_SB_SW_Fail_1,
WUT_Pipe_Ends_SB_SW_Fail_2,
WUT_Pipe_Ends_SB_SW_Fail_3,
Body_Alarm_Drawing_1,
Body_Alarm_Drawing_1_2,
Body_Alarm_Drawing_2,
Body_Alarm_Drawing_2_2,
Body_Alarm_Drawing_3,
Body_Alarm_Drawing_3_2,
Body_Alarm_Drawing_4,
Body_Alarm_Drawing_4_2,
Body_Alarm_Drawing_5,
Body_Alarm_Drawing_5_2,
Body_Alarm_Drawing_6,
Body_Alarm_Drawing_6_2,
Coil_Serial,
Current_Pipe_Length,
Current_Pipe_Weight,
Cust_Spec,
Cut_Off1_Op,
Cut_Off1_PT,
Cut_Off1_WS_Time,
Cycle_Pipe_Inspection_Alert,
Cycle_Reason,
Destination,
Downgrade_Code,
Downgrade_Display,
Downgrade_Reason,
Downgrade_Station,
Downgrade_Y_N,
E_EndUT_Op,
E_EndUT_WS_Time,
E_EndXray_WS_Time,
E_Xray_Op,
East_Xray_A252_Bool,
East_Xray_API_Bool,
East_Xray_Fail_Bool,
East_Xray_Pass_Bool,
East_Xray_PF,
East_XrayTestCrit,
End_Face_E_Op,
End_Face_PT,
End_Face_W_Op,
End_Face_WS_Time,
End_Sizer_E_Op,
End_Sizer_PT,
End_Sizer_W_Op,
End_Sizer_WS_Time,
Fail_Bool,
Fail_SB_East_Bool,
Fail_SB_West_Bool,
Fail_SW_East_Bool,
Fail_SW_West_Bool,
FI_Alm_CutH,
FI_Alm_CutT,
FI_Alm_RG1,
FI_Alm_RG2,
FI_Alm_RG3,
FI_Alm_RG4,
FI_Alm_RG5,
FI_Alm_RG6,
FI_Alm1,
FI_Alm2,
FI_Alm3,
FI_Alm4,
FI_Alm5,
FI_Alm6,
FI_Com1,
FI_Com2,
FI_Com3,
FI_Com4,
FI_Com5,
FI_Com6,
FI_Def_CutH,
FI_Def_CutT,
FI_Def_RG1,
FI_Def_RG2)
Select '06L3W0999A',
Auto_Hold,
Badge_Number,
FI_Def_RG3,
FI_Def_RG4,
FI_Def_RG5,
FI_Def_RG6,
FI_Def1,
FI_Def2,
FI_Def3,
FI_Def4,
FI_Def5,
FI_Def6,
FI_Dis1,
FI_Dis2,
FI_Dis3,
FI_Dis4,
FI_Dis5,
FI_Dis6,
FI_End_CutH,
FI_End_CutT,
FI_End_RG1,
FI_End_RG2,
FI_End_RG3,
FI_End_RG4,
FI_End_RG5,
FI_End_RG6,
FI_End1,
FI_End2,
FI_End3,
FI_End4,
FI_End5,
FI_End6,
FI_Image_CutH,
FI_Image_CutT,
FI_Image_RG1,
FI_Image_RG2,
FI_Image_RG3,
FI_Image_RG4,
FI_Image_RG5,
FI_Image_RG6,
FI_Loc,
FI_Loc_CutH,
FI_Loc_CutT,
FI_Loc_Gnd1,
FI_Loc_Gnd2,
FI_Loc_Gnd3,
FI_Loc_Gnd4,
FI_Loc_Gnd5,
FI_Loc_Gnd6,
FI_Loc_Rep1,
FI_Loc_Rep2,
FI_Loc_Rep3,
FI_Loc_Rep4,
FI_Loc_Rep5,
FI_Loc_Rep6,
FI_Loc1,
FI_Loc2,
FI_Loc3,
FI_Loc4,
FI_Loc5,
FI_Loc6,
FI_Rml1,
FI_Rml2,
FI_Rml3,
FI_Rml4,
FI_Rml5,
FI_Rml6,
Final_Ins_Fail_Bool,
Final_Ins_Pass_Bool,
Final_Insp_Op,
Final_Insp_WS_Time,
Final_Inspection_PF,
Final_Prove_Fail_Bool,
Final_Prove_Op,
Final_Prove_Pass_Bool,
Final_Prove_PF,
Final_Prove_WS_Time,
Final_UT_Alarm_Loc_1,
Final_UT_Alarm_Loc_2,
Final_UT_Alarm_Loc_3,
Final_UT_Alarm_Loc_4,
Final_UT_Alarm_Loc_5,
Final_UT_Alarm_Loc_6,
Final_UT_Alarm_Loc_7,
Final_UT_Alarm_Loc_8,
Final_UT_Body_A_Bool,
Final_UT_Body_F_Bool,
Final_UT_Body_N_Bool,
Final_UT_Body_P_Bool,
Final_UT_Body_PF,
Final_UT_BodyTestCrit,
Final_UT_Chan_Def_1,
Final_UT_Chan_Def_2,
Final_UT_Chan_Def_3,
Final_UT_Chan_Def_4,
Final_UT_Chan_Def_5,
Final_UT_Chan_Def_6,
Final_UT_Chan_Def_7,
Final_UT_Chan_Def_8,
Final_UT_Channel_1,
Final_UT_Channel_2,
Final_UT_Channel_3,
Final_UT_Channel_4,
Final_UT_Channel_5,
Final_UT_Channel_6,
Final_UT_Channel_7,
Final_UT_Channel_8,
Final_UT_Comment_1,
Final_UT_Comment_2,
Final_UT_Comment_3,
Final_UT_Comment_4,
Final_UT_Comment_5,
Final_UT_Comment_6,
Final_UT_Comment_7,
Final_UT_Comment_8,
Final_UT_Inspection_Alert,
Final_UT_Op,
Final_UT_Times_Through,
Final_UT_Weld_A_Bool,
Final_UT_Weld_F_Bool,
Final_UT_Weld_N_Bool,
Final_UT_Weld_P_Bool,
Final_UT_Weld_PF,
Final_UT_Weld_Retest,
Final_UT_WeldTestCrit,
Final_UT_WS_Time,
Gauge,
Heat_Nr,
Hydro_Fail_Bool,
Hydro_Hold_Bool,
Hydro_Inspection_Alert,
Hydro_No_Test_Bool,
Hydro_Op,
Hydro_Pass_A252_Bool,
Hydro_Pass_API_Bool,
Hydro_Pass_Bool,
Hydro_Pass_Test_Bool,
Hydro_PF,
Hydro_WS_Pres,
Hydro_WS_Time,
Job_Number,
Length_Fail_Bool,
Length_Pass_Bool,
M_U_T_Alarm_1,
M_U_T_Alarm_2,
M_U_T_Alarm_3,
M_U_T_Alarm_4,
M_U_T_Alarm_5,
M_U_T_Alarm_6,
M_U_T_Alarm_7,
M_U_T_Alarm_8,
M_U_T_Alarm_Com_1,
M_U_T_Alarm_Com_2,
M_U_T_Alarm_Com_3,
M_U_T_Alarm_Com_4,
M_U_T_Alarm_Com_5,
M_U_T_Alarm_Com_6,
M_U_T_Alarm_Com_7,
M_U_T_Alarm_Com_8,
M_U_T_Alarm_Def_1,
M_U_T_Alarm_Def_2,
M_U_T_Alarm_Def_3,
M_U_T_Alarm_Def_4,
M_U_T_Alarm_Def_5,
M_U_T_Alarm_Def_6,
M_U_T_Alarm_Def_7,
M_U_T_Alarm_Def_8,
M_U_T_Alarm_Loc_1,
M_U_T_Alarm_Loc_2,
M_U_T_Alarm_Loc_3,
M_U_T_Alarm_Loc_4,
M_U_T_Alarm_Loc_5,
M_U_T_Alarm_Loc_6,
M_U_T_Alarm_Loc_7,
M_U_T_Alarm_Loc_8,
M_U_T_Inspection_Alert,
M_U_T_Op,
M_U_T_PF,
M_U_T_PF_Bool,
M_U_T_WS_Time,
Mark_PT,
Mark_WS_Time,
Marking_Op,
Mill_Control_Alarm_1,
Mill_Control_Alarm_1_2,
Mill_Control_Alarm_2,
Mill_Control_Alarm_2_2,
Mill_Control_Alarm_3,
Mill_Control_Alarm_3_2,
Mill_Control_Alarm_4,
Mill_Control_Alarm_4_2,
Mill_Control_Alarm_5,
Mill_Control_Alarm_5_2,
Mill_Control_Alarm_6,
Mill_Control_Alarm_6_2,
No_Test_Bool,
NoTest_SW_East_Bool,
NoTest_SW_West_Bool,
OD,
OD_Mark_Op,
OD_Mark_PT,
OD_Mark_WS_Time,
Order_Grade,
Pass_Bool,
Pass_SB_East_Bool,
Pass_SB_West_Bool,
Pass_SW_East_Bool,
Pass_SW_West_Bool,
Pipe_CO_Inspection_Alert,
Pipe_Length,
Pipe_Length_PF,
Pipe_Status,
Pipe_Weight_PF,
Pre_Ins_Fail_Bool,
Pre_Ins_Pass_Bool,
Pre_Insp_Op,
Pre_Insp_WS_Time,
Pre_Inspection_PF,
Prove_F_Alm_Cut,
Prove_F_Alm_RG1,
Prove_F_Alm_RG2,
Prove_F_Alm_RG3,
Prove_F_Alm_RG4,
Prove_F_Alm_RG5,
Prove_F_Alm_RG6,
Prove_F_Def_Cut,
Prove_F_Def_RG1,
Prove_F_Def_RG2,
Prove_F_Def_RG3,
Prove_F_Def_RG4,
Prove_F_Def_RG5,
Prove_F_Def_RG6,
Prove_F_Loc_Cut,
Prove_F_Loc_Gnd1,
Prove_F_Loc_Gnd2,
Prove_F_Loc_Gnd3,
Prove_F_Loc_Gnd4,
Prove_F_Loc_Gnd5,
Prove_F_Loc_Gnd6,
Prove_F_Loc_Rep1,
Prove_F_Loc_Rep2,
Prove_F_Loc_Rep3,
Prove_F_Loc_Rep4,
Prove_F_Loc_Rep5,
Prove_F_Loc_Rep6,
Prove_Fail_Bool,
Prove_M_Alm_Cut1,
Prove_M_Alm_Cut2,
Prove_M_Alm_Cut3,
Prove_M_Alm_Cut4,
Prove_M_Alm_Cut5,
Prove_M_Alm_Cut6,
Prove_M_Alm_Cut7,
Prove_M_Alm_Cut8,
Prove_M_Alm_RG1,
Prove_M_Alm_RG2,
Prove_M_Alm_RG3,
Prove_M_Alm_RG4,
Prove_M_Alm_RG5,
Prove_M_Alm_RG6,
Prove_M_Alm_RG7,
Prove_M_Alm_RG8,
Prove_M_Def_Cut1,
Prove_M_Def_Cut2,
Prove_M_Def_Cut3,
Prove_M_Def_Cut4,
Prove_M_Def_Cut5,
Prove_M_Def_Cut6,
Prove_M_Def_Cut7,
Prove_M_Def_Cut8,
Prove_M_Def_RG1,
Prove_M_Def_RG2,
Prove_M_Def_RG3,
Prove_M_Def_RG4,
Prove_M_Def_RG5,
Prove_M_Def_RG6,
Prove_M_Def_RG7,
Prove_M_Def_RG8,
Prove_M_Loc_Cut1,
Prove_M_Loc_Cut2,
Prove_M_Loc_Cut3,
Prove_M_Loc_Cut4,
Prove_M_Loc_Cut5,
Prove_M_Loc_Cut6,
Prove_M_Loc_Cut7,
Prove_M_Loc_Cut8,
Prove_M_Loc_Gnd1,
Prove_M_Loc_Gnd2,
Prove_M_Loc_Gnd3,
Prove_M_Loc_Gnd4,
Prove_M_Loc_Gnd5,
Prove_M_Loc_Gnd6,
Prove_M_Loc_Gnd7,
Prove_M_Loc_Gnd8,
Prove_M_Loc_Rep1,
Prove_M_Loc_Rep2,
Prove_M_Loc_Rep3,
Prove_M_Loc_Rep4,
Prove_M_Loc_Rep5,
Prove_M_Loc_Rep6,
Prove_M_Loc_Rep7,
Prove_M_Loc_Rep8,
Prove_Op,
Prove_Pass_Bool,
Prove_PF,
Prove_Up_Inspection_Alert,
Prove_WS_Time,
Recheck_Integ,
Rehydro,
Rework_Pipe_Inspection_Alert,
RTR_Alarm_Drawing_1,
RTR_Alarm_Drawing_1_2,
RTR_Alarm_Drawing_2,
RTR_Alarm_Drawing_2_2,
RTR_Alarm_Drawing_3,
RTR_Alarm_Drawing_3_2,
RTR_Alarm_Drawing_4,
RTR_Alarm_Drawing_4_2,
RTR_Alarm_Drawing_5,
RTR_Alarm_Drawing_5_2,
RTR_Alarm_Drawing_6,
RTR_Alarm_Drawing_6_2,
RTR_Alm_CutH,
RTR_Alm_CutT,
RTR_Alm_RG1,
RTR_Alm_RG2,
RTR_Alm_RG3,
RTR_Alm_RG4,
RTR_Alm_RG5,
RTR_Alm_RG6,
RTR_Comment_Image_1,
RTR_Comment_Image_2,
RTR_Comment_Image_3,
RTR_Comment_Image_4,
RTR_Comment_Image_5,
RTR_Comment_Image_6,
RTR_Def_CutH,
RTR_Def_CutT,
RTR_Def_RG1,
RTR_Def_RG2,
RTR_Def_RG3,
RTR_Def_RG4,
RTR_Def_RG5,
RTR_Def_RG6,
RTR_Defect_1,
RTR_Defect_2,
RTR_Defect_3,
RTR_Defect_4,
RTR_Defect_5,
RTR_Defect_6,
RTR_Defect_Def_1,
RTR_Defect_Def_2,
RTR_Defect_Def_3,
RTR_Defect_Def_4,
RTR_Defect_Def_5,
RTR_Defect_Def_6,
RTR_Disp_1,
RTR_Disp_2,
RTR_Disp_3,
RTR_Disp_4,
RTR_Disp_5,
RTR_Disp_6,
RTR_E_Op,
RTR_E_PF,
RTR_E_WS_Time,
RTR_East_Bool,
RTR_East_PF,
RTR_EastTestCrit,
RTR_End_CutH,
RTR_End_CutT,
RTR_End_RG1,
RTR_End_RG2,
RTR_End_RG3,
RTR_End_RG4,
RTR_End_RG5,
RTR_End_RG6,
RTR_EW_PF,
RTR_Grind_Location_1,
RTR_Grind_Location_2,
RTR_Grind_Location_3,
RTR_Grind_Location_4,
RTR_Grind_Location_5,
RTR_Grind_Location_6,
RTR_Image_CutH,
RTR_Image_CutT,
RTR_Image_Req_1,
RTR_Image_Req_2,
RTR_Image_Req_3,
RTR_Image_Req_4,
RTR_Image_Req_5,
RTR_Image_Req_6,
RTR_Image_RG1,
RTR_Image_RG2,
RTR_Image_RG3,
RTR_Image_RG4,
RTR_Image_RG5,
RTR_Image_RG6,
RTR_Loc_CutH,
RTR_Loc_CutT,
RTR_Loc_Gnd1,
RTR_Loc_Gnd2,
RTR_Loc_Gnd3,
RTR_Loc_Gnd4,
RTR_Loc_Gnd5,
RTR_Loc_Gnd6,
RTR_Loc_Rep1,
RTR_Loc_Rep2,
RTR_Loc_Rep3,
RTR_Loc_Rep4,
RTR_Loc_Rep5,
RTR_Loc_Rep6,
RTR_PF,
RTR_Pipe_End_1,
RTR_Pipe_End_2,
RTR_Pipe_End_3,
RTR_Pipe_End_4,
RTR_Pipe_End_5,
RTR_Pipe_End_6,
RTR_Repair_Loc_1,
RTR_Repair_Loc_2,
RTR_Repair_Loc_3,
RTR_Repair_Loc_4,
RTR_Repair_Loc_5,
RTR_Repair_Loc_6,
RTR_W_Op,
RTR_West_Bool,
RTR_West_PF,
RTR_WestTestCrit,
RTR_WS_Time,
SB_East_PF,
SB_West_PF,
Secondary_Downgrade_Reason,
Sequence_Check,
Springback,
SW_East_PF,
SW_West_PF,
Test_Pipe,
Throwaway,
Time_Cut,
UT_Pipe_Ends_Comment_1,
UT_Pipe_Ends_Comment_2,
UT_Pipe_Ends_Comment_3,
UT_Pipe_Ends_Cut_L_1,
UT_Pipe_Ends_Cut_L_2,
UT_Pipe_Ends_Cut_L_3,
UT_Pipe_Ends_Defect_Code_1,
UT_Pipe_Ends_Defect_Code_2,
UT_Pipe_Ends_Defect_Code_3,
UT_Pipe_Ends_Definition_1,
UT_Pipe_Ends_Definition_2,
UT_Pipe_Ends_Definition_3,
UT_Pipe_Ends_East_PF,
UT_Pipe_Ends_End_1,
UT_Pipe_Ends_End_2,
UT_Pipe_Ends_End_3,
UT_Pipe_Ends_Inspection_Alert,
UT_Pipe_Ends_SB_SW_Fail_1,
UT_Pipe_Ends_SB_SW_Fail_2,
UT_Pipe_Ends_SB_SW_Fail_3,
UT_Pipe_Ends_West_PF,
W_EndUT_Op,
W_EndUT_WS_Time,
W_EndXray_WS_Time,
W_Xray_Op,
Weigh_and_M_PF,
Weigh_Op,
Weigh_WS_Time,
Weight_Fail_Bool,
Weight_Pass_Bool,
Weld_Rep_Inspection_Alert,
Weld_Rep_Op,
Weld_Rep_PT,
Weld_Rep_WS_Time,
West_Xray_A252_Bool,
West_Xray_API_Bool,
West_Xray_Fail_Bool,
West_Xray_Pass_Bool,
West_Xray_PF,
West_XrayTestCrit,
WUT_Pipe_Ends_Comment_1,
WUT_Pipe_Ends_Comment_2,
WUT_Pipe_Ends_Comment_3,
WUT_Pipe_Ends_Cut_L_1,
WUT_Pipe_Ends_Cut_L_2,
WUT_Pipe_Ends_Cut_L_3,
WUT_Pipe_Ends_Defect_Code_1,
WUT_Pipe_Ends_Defect_Code_2,
WUT_Pipe_Ends_Defect_Code_3,
WUT_Pipe_Ends_Definition_1,
WUT_Pipe_Ends_Definition_2,
WUT_Pipe_Ends_Definition_3,
WUT_Pipe_Ends_End_1,
WUT_Pipe_Ends_End_2,
WUT_Pipe_Ends_End_3,
WUT_Pipe_Ends_SB_SW_Fail_1,
WUT_Pipe_Ends_SB_SW_Fail_2,
WUT_Pipe_Ends_SB_SW_Fail_3,
Body_Alarm_Drawing_1,
Body_Alarm_Drawing_1_2,
Body_Alarm_Drawing_2,
Body_Alarm_Drawing_2_2,
Body_Alarm_Drawing_3,
Body_Alarm_Drawing_3_2,
Body_Alarm_Drawing_4,
Body_Alarm_Drawing_4_2,
Body_Alarm_Drawing_5,
Body_Alarm_Drawing_5_2,
Body_Alarm_Drawing_6,
Body_Alarm_Drawing_6_2,
Coil_Serial,
Current_Pipe_Length,
Current_Pipe_Weight,
Cust_Spec,
Cut_Off1_Op,
Cut_Off1_PT,
Cut_Off1_WS_Time,
Cycle_Pipe_Inspection_Alert,
Cycle_Reason,
Destination,
Downgrade_Code,
Downgrade_Display,
Downgrade_Reason,
Downgrade_Station,
Downgrade_Y_N,
E_EndUT_Op,
E_EndUT_WS_Time,
E_EndXray_WS_Time,
E_Xray_Op,
East_Xray_A252_Bool,
East_Xray_API_Bool,
East_Xray_Fail_Bool,
East_Xray_Pass_Bool,
East_Xray_PF,
East_XrayTestCrit,
End_Face_E_Op,
End_Face_PT,
End_Face_W_Op,
End_Face_WS_Time,
End_Sizer_E_Op,
End_Sizer_PT,
End_Sizer_W_Op,
End_Sizer_WS_Time,
Fail_Bool,
Fail_SB_East_Bool,
Fail_SB_West_Bool,
Fail_SW_East_Bool,
Fail_SW_West_Bool,
FI_Alm_CutH,
FI_Alm_CutT,
FI_Alm_RG1,
FI_Alm_RG2,
FI_Alm_RG3,
FI_Alm_RG4,
FI_Alm_RG5,
FI_Alm_RG6,
FI_Alm1,
FI_Alm2,
FI_Alm3,
FI_Alm4,
FI_Alm5,
FI_Alm6,
FI_Com1,
FI_Com2,
FI_Com3,
FI_Com4,
FI_Com5,
FI_Com6,
FI_Def_CutH,
FI_Def_CutT,
FI_Def_RG1,
FI_Def_RG2
From Pipe_Serial
Where Pipe_Serial = '06L3W0999'
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-28 : 18:07:30
Nothing appears wrong with that query. I guess SQL can't handle how many columns you've got, but it should be able to as you haven't hit the maximum.

Some serious normalization on that table needs to take place. What you've got there looks like it was converted from a flat file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

JerkofallTrades
Starting Member

5 Posts

Posted - 2008-04-28 : 18:37:17
It is in fact, 572 fields. As for the need to break this up there can be no question. I think this started out based on the original plan for there to be 12 stations, with a pass/fail, date & time, and the operator number being all that was to be recorded.

Feature creep took care of the rest. Each station (now 54) has it's own table and this has outlived it's purpose, but I can't get rid of it until I rewrite each station to refer to the upstream local tables.

In the meanwhile we need to be able to record the mother/daughter cut pipes so that's why I'm trying to do this the "easy" way.

Thanks for your help Tara, I do appreciate it.
Go to Top of Page

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2008-04-29 : 13:59:47
How are the records getting inserted now without getting this error?




An infinite universe is the ultimate cartesian product.
Go to Top of Page
   

- Advertisement -