Hello,

I have a table with 300,000 records, 150 fields. One of the fields is a
counter field which is blank/null while I am retrieving data. After I
have collected the 300,000 recs I want to add numbers to the counter
field, increment the counter field (ordering not an issue) like rec1 is
1, rec2 is 2...recn is n.

In VB I could make an ADO connection to the table and do a
Do While Not RS.EOF
RS.Edit
RS.Counter = i
RS.Update
i = i + 1
RS.MoveNext
Loop

But I would like to do this in an SP from Query yzer. I was
thinking of creating an sp which calls a UDF like (pseudo code)

...
Begin
Update tbl1 Set fldCounter = dbo.fcnCount(fldCounter)
Go

Here is fcnCount

Create Function (fldCount As bigInt)
Returns bigInt
AS
Begin
Declare Inc As bigInt
Set Inc = fldCount + 1
Return = Inc
End

Is this doable?

Thanks,
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!