Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Netherlands
    Posts
    98

    Unanswered: Auto fill in colums trough foreign key relationship

    Hi,

    I have a table users where there is a user_id and an department column.
    Also i have a table called KRS where there are the same columns, when a userid is given i want to auto fill in the departmentid,

    Can someone help me with this?

    Cheers Wim

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You want help creating a denormalized database?

    [sigh...]

    If you absolutely need to do this, you can accomplish it through an INSERT trigger on your KRS table.

    Why are you duplicating data like this?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by blindman
    You want help creating a denormalized database?

    [sigh...]

    If you absolutely need to do this, you can accomplish it through an INSERT trigger on your KRS table.

    Why are you duplicating data like this?
    I keep trying to shoot myself it the foot, but the rifle wobbles when I pull the trigger. Can one of you guys hold it for me?

    I actually thought about trying to formulate a reply to this question, but nothing I wrote seemed fit to post. I'm thinking that a VIEW would make life a lot easier in the long run, what do you think?

    -PatP

Posting Permissions

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