Вопрос

I am working on a c# program that will be used by 20 to 60 users concurrently. The users will input information into various text fields and select from combo boxes and then save the information to a shared database. My question is how can I create a unique ID for each entry to the database so that they can later do a search by the ID? By preference I would like the ID to be less than 8 characters or digits. The database is designed in SQL Server 2012 Express.

Thanks for sharing!

Это было полезно?

Решение

I think you are looking for an identity column. It would give you a unique ID for every row that is inserted. Identity columns are unique for each row and automatically increment themselves each time you create a row.

Here are two resources to help you out:

Другие советы

Thanks for all your posts, I was able to use an identity column which turned out great i specified the starting position in the identity column. Thanks

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top