INSTEAD OF TRIGGER-WITHOUT ROLLBACK
 




IT Certification FAQ

 
|
Home
|
Microsoft
|
CISCO
|
CompTIA
|
Exam/Study FAQ
|
Employment FAQ
| Links  | Forums  |
Book Reviews


FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  ProfileProfile  Log in to check your private messagesPrivate messages  Log inLog in

INSTEAD OF TRIGGER-WITHOUT ROLLBACK

 
Post new topic   Reply to topic    Forum Index -> microsoft.public.cert.exam.mcsd
Author Message
Kaimuri
Guest





PostPosted: Thu Jan 06, 2005 3:30 pm    Post subject: INSTEAD OF TRIGGER-WITHOUT ROLLBACK Reply with quote

I saw a comment in a book that in this INSTEAD OF Trigger, the fact that
there is no rollback is an advantage. How is that?

CREATE TRIGGER InsOrdDet ON [Order Details] INSTEAD OF INSERT AS DECLARE
@qty int SELECT @qty=quantity FROM Inserted IF @qty<=(SELECT UnitsInStock

FROM Products P JOIN Inserted I

ON P.ProductID=I.ProductID)

INSERT INTO [Order Details]

SELECT * FROM Inserted

ELSE

RAISERROR('Not enough products in stock', 16, 1)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> microsoft.public.cert.exam.mcsd All times are GMT
Page 1 of 1

 

Copyright © 2002-2006 Web-S-Sense Pty. Ltd. All rights reserved.

Powered by phpBB
Advertising | Policies/Disclaimers | Contact us | Link to us


Featured Sites: Free Antivirus and Antispyware Info | Free PC Support | MCSE Directory