Disclaimer: I'm a database novice teaching myself for a research project.

Background: I am querying an electronic medical record (EMR) system for information pertinent to my project and I do not want to store medical record numbers (just say "no" HIPAA violations!). The database is designed with Visit_ID as a Primary Key and four fields which result in a unique combination: admission date & time, length of stay, admitting physician, and room number. All other information will be based on the Visit_ID. For example, the "Medications" table starts with Visit_ID as a Foreign Key and all other information such as start date, stop date, etc.

Problem: The EMR system obviously does not know my Visit_ID. Therefore, all of my queries will have the four fields which are defined by Visit_ID in my database.

Question: Can I resolve or lookup the Visit_ID within the database from the four columns in my Excel sheet?

Example: I query the EMR for the medications the patients had in June. My query returns an Excel spreadsheet with my four fields (Admission Date & Time, Admitting Physician, Length of Stay, and Room) and all the necessary information about the medications. Can I import data from that Excel spreadsheet into my "Medications" table but have SQL Server resolve Visit_ID instead of keeping those four fields?

1 Answer 1


Yes, Excel can query data from a database. On the Data tab there are tools to create and maintain connections. IIRC it uses ODBC so all major database products can be referenced.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.