View Single Post
  #3 (permalink)  
Old November 30th, 2003, 11:04 AM
Jeff Mason Jeff Mason is offline
Friend of Wrox
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post

Subqueries are not allowed in the VALUES clause of an INSERT statement. You can use a derived table as the source of the INSERT values instead:
INSERT INTO MyTable (ExperimentID, Threshold, Energy)
    SELECT @newID, Threshold, Energy
        FROM OldTable WHERE ExperimentID = @oldID;
Jeff Mason
Custom Apps, Inc.