|
Skydolphin
Starting Member
43 Posts |
Posted - 2003-07-11 : 13:30:43
|
| Hi All,I am trying to write a stored procedure that runs a simple select statement, gets the values of certain fields in the table and inserts them along with some other fields into a new table. The queries run but the insert only happens for the last record returned from the select. How can I loop through the results inserting a record for each one?All of the other fields are either set using a declare or are passed in the procedure.BEGINSelect @strBarcode = Barcode, @strLID = LID from TableNameInsert into newTable(Drawing_Type, Barcode, Sheet_Dim, Page, Description, Date, LID, Notes, SCovr, SIndx, SPlan, SProf, SDet, SNote, Station_No, Original_Page, Category_No, Dwg_No, Type, FNew, FRest, FPark, FExist) values (@strDrawing_Type, @strBarcode, @strSheet_Dim, @strPage, @strDescription, @strDate, @strLID, @strNotes, @strSCovr, @strSIndx, @strSPlan, @strSProf, @strSDet, @strSNote, @strStation_No, @strOriginal_Page, @strCategory_No, @strDwg_No, @strType, @strFNew, @strFRest, @strFPark, @strFExist)ENDAny ideas would be greatly appreciated. ThanksRhonda |
|