Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Issue with Trigger

Author  Topic 

tvb2727
Starting Member

35 Posts

Posted - 2010-10-16 : 22:50:58
Below is the trigger I am running on a Table called TRUCK. The issue is when i run it I see the print statements and the v3 and v4 are the same, so the update statement is already happening before I run my select statement. I need to make sure the truck miles is not less when an update is done. If I do a = in the If statement the error fires. How to I check before the update occurs?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-16 : 23:37:42
quote:

Below is the trigger



You didn't post it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tvb2727
Starting Member

35 Posts

Posted - 2010-10-17 : 00:07:39
I figured it out. Had to use an Instead OF and then do an if statement with a begin..end in the first part of the if and a begin..end in the else part
Go to Top of Page

tvb2727
Starting Member

35 Posts

Posted - 2010-10-17 : 00:11:18
I figured it out
Go to Top of Page
   

- Advertisement -