Sql-server – an appropriate datatype for an RFID, and is there a standard definition for the format

datatypessql server

I have a database that tracks people based on RFID tags embedded in their shoes. This data arrives in a VARCHAR(MAX) column with other data mixed in, in no particular order. So far, all the RFID values are formatted like the following:

AnnnnnnnnAnnAAAA  (where A = 0-9  and n = A-Z)

I am writing a report to extract RFIDs from these messages and store them in their own table. As long as the RFIDs follow this same pattern, I can find them. If the RFID format changes, my extraction process will fail.

Is there a standard format for RFID tags? What datatype would be best suited to store RFID tags?

I am going with VARCHAR(20) for now.

Best Answer

RFID today is made basically of two standards, being HF (13.56MHz) and UHF (800-900MHz depending if Europe/US)

HF tags usually have one Unique Identifier, called UID, that is 64 bits in size. The UID is usually guaranteed to be unique by the producer of the IC and is read only.

HF tags are usually used for ticketing, anti counterfeiting, brand protection applications. HF tags usually have some user memory too, that can vary from a few bits to usually a maximum of 4Kbits, but special application ICs exist with memory up to 80-90Kbit (i.e. RFID passport chips). It is not common to have to store the contents of this data in an external database, but if you do, you need to know the model of the IC.

UHF tags, on the other hand, usually have a 96 or 128 bit EPC (256 bit EPC models are emerging), that is not generally unique and it is reprogrammable. Each application / system integrator usually programs the EPC according to the needs of the application

UHF tags are mostly used for logistics and tracking and many tags do not have user memory. Some models do have it, but it is usually very limited (128 or 256 bits). Of course there are exceptions.

In most applications you will just receive the UID or EPC of the tag, and you will need to store only that. This usually means that a 64 bit number for UID or a uuid field for EPC should be enough.