troubleshooting Question

How can I generate unique IDs for different items inserted into a table

Avatar of obb-taurus
obb-taurusFlag for Canada asked on
Microsoft SQL Server.NET Programming
3 Comments2 Solutions280 ViewsLast Modified:
I'm working on an inventory application and a requirement is that the system generate a unique stock number for each item.  The only hitch is that there are several categories and each category needs to follow it's own numbering sequence.

To give a very bad example of what I'm trying to accomplish, in essence it would be like creating a table for each category and having an identity in each of those tables, this way whenever a new item is inserted into a specific category the numeric sequence would be consistent eg. 1001, 1002, 1003 etc.

I'm just looking for a better way to achieve what I've outlined in my above example.

Hope this make sense.

Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros