View Single Post
  #2 (permalink)  
Old November 30th, 2003, 10:56 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Pankaj,

I think you need to fix two things: you should leave out VALUES and you need to swap the order of the SQL statement that retrieves the records. This should work:

INSERT INTO MyTable(ExperimentID, Threshold, Energy) SELECT @newID Threshold, Energy FROM OldTable WHERE ExperimentID = @oldID

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.