Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2003, 06:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sorry, I'm not going to "...write the trigger out in full..." for you. I'll try to help you write it, though. I don't mean to be difficult here, but I ascribe to that theory about "...teaching a man to fish...".

If you are getting an error about 'tbl_session_booking' being an unrecognized column, then your code is placing that table name in a context where the compiler expects a column name. So, for example, in my previous suggestion:
Code:
    UPDATE tbl_session_booking
     ...
    ON tbl_session_booking.<primarykeycolumn>=inserted.<primarykeycolumn
since you've said your primary key is 'booking_id', the code should read something like:
Code:
    UPDATE tbl_session_booking
     ...
    ON tbl_session_booking.booking_id=inserted.booking_id
did you perhaps forget the period between the table name and the column name? If you post the code you are having trouble with maybe together we can figure out what you are doing wrong.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trigger : after update insert into second table ik SQL Server 2000 4 January 30th, 2009 12:32 AM
trigger to insert current date on insert kev_79 SQL Server 2000 3 January 23rd, 2006 05:58 PM
insert,update trigger rolle SQL Server 2000 3 September 29th, 2005 08:41 PM
Help With INSERT + UPDATE Trigger HenryE SQL Server 2000 1 December 11th, 2003 06:26 PM
Update, insert and delete Trigger khautinh SQL Server 2000 2 September 17th, 2003 11:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.