troubleshooting Question

Easiest way to insert lookup data along with master data

Avatar of batchakamal
batchakamalFlag for India asked on
Microsoft SQL Server 2008
4 Comments1 Solution266 ViewsLast Modified:
I have a master table in which more than 25 foreign keys are there pointing to different lookup tables.

For eg, I have a table called StudentMaster with

StudentID (PK),
CountryId (FK),
MartialStatus (FK),
Degree (FK),
MajorSubject (FK),
MinorSubject (FK),
University (FK) etc..

Now I am importing data from a temporary table and they have provided the values instead of codes in the Foreign Key values. Now I need to write a script to import these data into my table. When importing data if any lookup value found I need to insert them into the lookup table and then insert the master data along with new lookup codes.

Please advice..
Join our community to see this answer!
Unlock 1 Answer and 4 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 1 Answer and 4 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