SQLTeam.com | Weblogs | Forums

Insert into Reference Table with Foreign Keys from 2 tables

#1

I am trying to create an insert statement for inserting values into the table "ext_ln_element_map" table where the insert should NOT create duplicates based on the 2 foreign keys (ext_src_element_id and ln_std_element_id).

The data to be inserted is in excel where the columns in the excel sheet are as below:
ln_data_level_name, ln_element_name, ext_src_table_name, ext_src_element_name, ext_ln_element_map_rule, ext_ln_element_map_note.

The primary key in all tables are set to auto generate.

I am really struggling and would appreciate help.

Thanks so much in advance.

AKA

0 Likes

#2

hi

are you trying in SQL Server T-SQL ???

how exactly are you struggling ..please let us know ..
once we understand then we can help for sure
:slight_smile:
:slight_smile:

0 Likes

#3

I am using MySQL.

0 Likes

#4

this is a t sql forum

0 Likes

#5

Apologies.
Could you please suggest where can I post this for help.

0 Likes

#6

http://forums.devshed.com/mysql-help-4/

Please try this

you can google search MySQL Forums

hope this helps
:slight_smile:
:slight_smile:

0 Likes