Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. TRIGGER PROBLEM

TRIGGER PROBLEM

Scheduled Pinned Locked Moved Database
databasehelpsql-servercomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_3259094
    wrote on last edited by
    #1

    hi i have table1 (name[unique], address, phone) table2 (name[unique], occupation ) in my situation i am updating table2 name field value through procedure. so i want to create a trigger which change the relevant name field value of table1 using sql server 2000 please help me

    Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

    A 1 Reply Last reply
    0
    • M Member_3259094

      hi i have table1 (name[unique], address, phone) table2 (name[unique], occupation ) in my situation i am updating table2 name field value through procedure. so i want to create a trigger which change the relevant name field value of table1 using sql server 2000 please help me

      Rajeev Kr. Sharma VRI Software Pvt.Ltd. New Delhi India HumOnline.com Stay Connected

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      You can get the old value of the name from the deleted table and the new value of the name from the inserted record within your trigger. The deleted and inserted tables are special tables within a trigger, but if you are always updating using a stored prcoedure why not just update both atbles within a transaction. This will enaure referentail integrity too.

      Bob Ashfield Consultants Ltd

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups