I’ll be creating a ticketing system wherein a user can post a request and then the system is suppose to return a ticket number or reference number of the request to track its status. My question is it safe to use an auto number generated from sql server table to use as the reference number returned to the user? Guessing reference numbers will not be an issue because anyone should be able to check the status of the request since no sensitive data is involved. Could there be any best practice for this or any better approach? Thank you.
Share
Sure – using an
INT IDENTITYis probably the easiest and safest bet.SQL Server handles all everything for you – you just get a nice, clean number and be done with it.
If you want to, you can also combine a consecutive number (your
ID) with e.g. a project or product prefix to create “case numbers” likePROJ-000005,OTHR-000006and so forth. This can be very easily done by using a computed column in your table – something like this:Then your table would have an identity column
IDwith auto-generated numbers, some kind of a customer or project or product determinedPrefix, and your computed columnPrefixedNumberwould contain those fancy prefixed case numbers.