on 2024 Mar 26 1:37 PM
I am wanting to update the customernum field starting at 211001 and increment by 1. I can't find a script that makes it that simple. The scripts I found are based on another field and I have tried to adjust for that. It is not working. Do you know something I can use for something that simple?
Request clarification before answering.
I assume that column has an AUTOINCREMENT default. You can then
either explicitly set the value for an autoincrement column (because it's just a default for that column, and defaults can of course be overriden, so you could just insert the first row with number 211001),
or you can use the builtin stored procedure sa_reset_identity() to provide the next value. (Note: The value there is the "last one used", so you would set it to 211000.)
Autoincrements are always incremented by 1. For other steps, you would need a sequence instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
9 | |
9 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.