>hello naomi I'm talking about sql server 2005 and I can not update it in the insert, because the field ncf should be the max ncf +1 in the same table at which to insert as the invoice and both depend on the field tipncf
In the above sample, please show the insert command and what this record should become?
I have a feeling you need to use ROW_NUMBER() function, but it's not clear from your explanation what do you want.
If it's not broken, fix it until it is.
My Blog