As an example, the SQL script below selects all Contacts in CRM and iterates through them, setting their [AutoNumber] field equal to the Contact's database row number. The script also pads this number, to keep in alignment with my autonumber syntax, which is padded to be a minimum of 10 characters long. For example, a row number of 489 is padded to an autonumber of 0000000489
When using this script, replace:
- [AutoNumber] with the schema name of your autonumber field e.g. new_autonumber
- [Database] with the name of your CRM database
- [ContactBase] with the table of the entity you're looking to update. You'll also need to replace ContactId with the primary id of this entity
I recommend this autonumber from Celodon, the code for which is hosted here on GitHub.
No comments:
Post a Comment