Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 19th, 2004, 03:36 AM
Kris_Vanherck's Avatar
Kris_Vanherck Kris_Vanherck is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Belgium, Antwerp
Posts: 177 Kris_Vanherck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 5
Question Constraints by triggers

after the bit field Locked is 1, no changes may occur to the record, the following trigger is the closest i can get to it, but now i can't put the Locked field to 1 either

can anyone correct my trigger or give me an alternitive way of implementing this on a database level ?

PHP Code:
 CREATE TRIGGER dbo.Locked_Constraint_Versie ON dbo.Offerte_Versie
AFTER UPDATE
AS
IF (
< (SELECT COUNT(*) FROM inserted WHERE inserted.Versie_ID IN (SELECT Offerte_Versie.Versie_ID FROM Offerte_Versie WHERE Offerte_Versie.Locked 1))  )
BEGIN
 RAISERROR
('Version is locked, no actions permitted',16,1)
 
ROLLBACK TRANSACTION
END 

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Constraints by triggers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT