INSERT INTO TONLINE_DEVICES ONLINE_DEVICE_ID SERIAL_NUMBER PORT SPEED

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
INSERT INTO TONLINE_DEVICES ( ONLINE_DEVICE_ID, SERIAL_NUMBER, PORT,
SPEED, ADDRESS, ONLINE_DEVICE_MODEL_ID,MACHINE_ID,LOGICAL_NUMBER )
SELECT
NEWID(), '', 1,115200,'',odm.ONLINE_DEVICE_MODEL_ID, @MachineID,1
FROM
TONLINE_DEVICE_MODELS odm,
TONL_DEV_MODEL_MM_SETTING_LINKS onll
WHERE
odm.ONLINE_DEVICE_MODEL_ID = onll.ONLINE_DEVICE_MODEL_ID AND
onll.MACHINE_MODEL_SETTING_ID = @MachineModelID