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.
Author |
Topic |
kwacz23
Starting Member
44 Posts |
Posted - 2012-05-17 : 13:53:21
|
hi, this trigger give me a error Msg 102, Level 15, State 1, Procedure ProduktyStan, Line 13Incorrect syntax near ')'.could you help mecreate trigger ProduktyStanon produktyfor update as if exists (select 'True' from inserted i join deleted d on i.produkt_id=d.produkt_idwhere (d.[ilosc w magazynie]-i.[ilosc w magazynie])>0and d.[ilosc w magazynie]-i.[ilosc w magazynie]>0)begin Raiserror ('Ilosc w magazynie nie moze byc ponizej stanu minimalnego');Rollback transaction end |
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-17 : 14:53:04
|
This wont give you compilation error and this will be created .But at run time this will failed . Try thsi create trigger ProduktyStanon produktyfor updateasif exists (select 'True' from inserted ijoin deleted don i.produkt_id=d.produkt_idwhere (d.[ilosc w magazynie]-i.[ilosc w magazynie])>0and d.[ilosc w magazynie]-i.[ilosc w magazynie]>0)begin--Raiserror ('Ilosc w magazynie nie moze byc ponizej stanu minimalnego');Rollback transactionendVijay is here to learn something from you guys. |
 |
|
|
|
|