• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

trigger

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have the following trigger which inserts the region field into the member table every time a user registers or updates their personal details through the website.
CREATE TRIGGER [regiontree] ON [member]
FOR INSERT, UPDATE
AS
UPDATE member SET region = Region.region FROM Region WHERE member.country = Region.country
However i have been told that to this trigger will update all the rows in the table every time.
How can i make this trigger to select one single row?
the member table has the unique identidier memberid.
The Region table doesnt have any unique identifier, it only contains two fields (region and country) and a fixed number of records (50 countries and 15 regions).
Many thanks for any help
Natalia http://www.nataliaz.com
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic