Home Forums SQL Server 2008 SQL Server Newbies Relational Database Creation - How does a key from one table get into another table as a foreign key? RE: Relational Database Creation - How does a key from one table get into another table as a foreign key?

  • There are three main ways.

    1) The key is included in the source data.

    2) Use the OUTPUT clause when you INSERT/MERGE the data into the user record to get the ID and any information necessary to link it to the Telephony table.

    3) Look up the data using a natural key after inserting the user record.

    Since we don't know what your source data looks like, we can't give you specifics.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA