Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Triggers
Message
 
 
To
24/02/2009 18:25:35
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01383955
Message ID:
01383956
Views:
56
>I have a situation where I have a table with this structure:
>
>ID (PK)
>ParentID (FK)
>PercentOwnership - Decimal (2,2)
>
>I want to check when an item is inserted or updated in this table that the sum of all PercentOwnership fields with the same ParentID doesn't go over 1. I'm assuming I want to use a trigger here and wanted to make sure I was going down the right path (I'm a newbie with triggers). Is this right? Or is there a better way to do this?

To me the problem sounds like a perfect candidate for an INSTEAD OF trigger.

http://articles.techrepublic.com.com/5100-10878_11-6113179.html
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform