OK, so this is probably going to be a dumb question but I am somewhat
of a beginner so please bare with me. Here is what I have:
Insert into activplant_data_exchg (record_ID, start_time, value,
status_id, trans_time, status_desc_id, meas_pt, meas_pt_desc,
sap_equip)
values (@.k+20, @.SampleDateTime, @.Target, '0', getdate(), '88') Select *
>From tMcCain_MeasuringPoint where meas_pt = (@.ProcessID + '_' + @.TestID
+ '_TARGET')
So I have 9 columns I want to enter data into and I want to get 6 of
those from variables and/or hard coding them and the last 3 I want to
get from a select statement. Is this possible and if so what is the
correct syntax to do this?
Thanks for your help.
BrianAssuming that the columns you are inserting from in
tMcCain_MeasuringPoint are named the same as those in
activplant_data_exchg, the following statement should get what you
want. You can basically add the constant values for those columns into
the select statement for insert:
Insert into activplant_data_exchg
(record_ID, start_time, value, status_id, trans_time, status_desc_id,
meas_pt, meas_pt_desc, sap_equip)
Select @.k+20, @.SampleDateTime, @.Target, '0', getdate(), '88', meas_pt,
meas_pt_desc, sap_equip
From tMcCain_MeasuringPoint
where meas_pt = (@.ProcessID + '_' + @.TestID + '_TARGET')
HTH
Jason Strate|||Perfect, thanks alot. I should have been able to figure that out!
Showing posts with label somewhatof. Show all posts
Showing posts with label somewhatof. Show all posts
Monday, March 12, 2012
Insert Statement questions
Subscribe to:
Posts (Atom)