简体   繁体   中英

Id in Database what datatype use?

I am working with Access database for a C# winform application.I want to create software, which stores the patient's details.I have assigned a patient_Id for each patient, Patient_Id is of "AutoNumber" datatype so that it will automatically increment. My problem is when same patient comes again then New Patient_Id automatically generated to store his new current data, but for same patient I want only one ID.

Use some unique data as a field in your patient table (such as social security) and when a patient comes, look up this unique number and determine if he is a new patient or a returning one. This is a simple SELECT query something like:

"SELECT patient_Id FROM tPatients WHERE SSN=@sNum"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM