SQL Server 2000 SP4
I am trying to create a Query to update one field from all records (100's of records) in a particuler table. So far I have only been successful in updating one record at a time. Here is what I have so far,
By changing the grpid I can update a specific record.
I was hoping to get something similar to this
but I keep getting syntax errors.
Can this be done and if so how?
zemp
I am trying to create a Query to update one field from all records (100's of records) in a particuler table. So far I have only been successful in updating one record at a time. Here is what I have so far,
Code:
declare @CID varchar(20)
set @CID = (select (dbo.udfFormatNum(annumber,1 )) from cfautonumber where anid=1)
UPDATE cfautonumber SET annumber = annumber + 1 where anid=1
Update maGroup set clientID=@CID where grpid=1
I was hoping to get something similar to this
Code:
Update maGroup set clientID=(
(select dbo.udfFormatNum(annumber,1 ) from cfautonumber where anid=1)
UPDATE cfautonumber SET annumber = annumber + 1 where anid=1
)
Can this be done and if so how?
zemp