#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Ms SQL 2008 - Trigger - Insert Value to Another Column


    Hi

    I have a table with several columns. However, there is another column that needs to be updated using the values from another column on the same table.

    The table name is dbo.userobject, the column where the values are store is called login, and the column that needs to be updated is email.

    The result is that everytime the "login" column has a value, the second column reflect the login value including "@email.com".

    Can anyone show an example for building a simple trigger?

    Thanks
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    you would not use a trigger for this, you would use a computed column
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo