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 April 15th, 2005, 10:43 AM
Authorized User
 
Join Date: Jun 2003
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trigger

Hi

Following an update trigger I need to manually compare 2 fields in the deleted and inserted tables.

Wat is the syntax I need to use - this is what I want but it is wrong.


'''''
if select ColourRef From deleted where ColourRef = select ColourRef from inserted
'''''

ANy help would be appreciated.

Andy
 
Old April 15th, 2005, 01:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Select the results into two variables, then check the values of the variables for compatibility.

select @iCR = ColourRef from inserted
select @dCR = ColourRef from deleted

if (@iCR = @dCR)
  -- do what

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trigger Help monika.vasvani SQL Language 2 March 1st, 2007 06:59 AM
Trigger arshad mahmood C++ Programming 4 June 24th, 2004 07:10 AM
Trigger ! minhtri Pro VB Databases 2 June 23rd, 2004 02:27 AM
Trigger arshad mahmood SQL Language 2 May 12th, 2004 05:16 AM
Using instead of trigger dmr999 SQL Server 2000 1 November 29th, 2003 02:35 PM





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