>(2) is what i needed ...
>Thanks for your help
>Jaime
You're welcome
And (1) will work as well
>
>>>Hi all
>>>In a sql table, i would like to insert a subset but changing the value in just 1 field.
>>>I have a table with fields field1, field2, field3. I would like to select all rows with value 5 in field1, and insert the result rowset but changing the value of field1 to 6 prior to inserting. Is it doable in one insert command?
>>>
>>>Thanks
>>>Jaime
>>
>>Jaime,
>>
>>This is vfp syntax - but I take it sqlserver as well - remove the semi colons
>>
>>
>> create cursor pp ;
>> ( field1 I, ;
>> field2 I, ;
>> Field3 I ;
>> )
>> insert into pp values (1, 2, 3)
>> insert into pp values (4, 5, 6)
>> insert into pp values (5, 6, 6)
>> insert into pp values (5, 7, 7)
>>
>> && (1)
>> insert into pp (field1, field2, field3 ) ;
>> select field1+1, field2, field3 ;
>> from pp ;
>> where (field1 = 5)
>>
>> && (2)
>> insert into pp (field1, field2, field3 ) ;
>> select 6, field2, field3 ;
>> from pp ;
>> where (field1 = 5)
Gregory