Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

Create a 8 digit auto number

Hi
I have been told we need an 8 digit auto number given to each new record in our table
starting at 00000001.

Can this be done ?

Thanks

Matt
0
dark22
Asked:
dark22
  • 2
  • 2
1 Solution
 
sm394Commented:
not sure about starting from 00000001
but one option could be to set 8 digit
DBCC CHECKIDENT('YourTable', RESEED, 10000000)
0
 
Patrick MatthewsCommented:
Hello dark22,

Why do you need to store the leading zeroes in the database?  Why not let it be a simple int identity column,
and then format the result to be 8 digits in your queries/reports?

Regards,

Patrick
0
 
dark22Author Commented:
that maybe the way to go, I don't need to store it in the database,
What happens is a query is run in Access 2000 to import certain records from the first DB into an access table.

Can you make the access table format it to 8 digits ?
0
 
Patrick MatthewsCommented:
dark22 said:
>>Can you make the access table format it to 8 digits ?

The same issue applies: you could build the import process to do this, but why bother?
0
 
dark22Author Commented:
Ok then from that point it is exported to CSV file and then imported into an accounts program.

It is the accounts program that requires an 8 digit account number for the record being imported.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now