Results 1 to 2 of 2

Thread: insert & foreign key

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    When I insert into table A a foreign key is referenced.

    The problem is that I need to insert into 2 tables at the same time, ie the original table and the table where the key is referenced.

    I've thought about joining the tables and then using insert but i can't find any documentation on how to do this.
    VB6 Enterprise sp5, SQL Server2000

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I would do two separate INSERTs, first to the "one"-side table, then to the "many"-side table.
    "It's cold gin time again ..."

    Check out my website here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width