Prev: Timeout after Mirroring Failover
Next: Using SSMS2008 to view Job Activity Monitor on SQL2005 - cw
From: Chaplain Doug on 8 Oct 2009 10:43 I have looked at the BOL. It is long on excruciating cryptic detail and short on down to earth examples. I cannot make heads nor tails of it. I guess that is my problem? -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org "TheSQLGuru" wrote: > Yepper - BOL is a WONDERFUL resource! > > -- > Kevin G. Boles > Indicium Resources, Inc. > SQL Server MVP > kgboles a earthlink dt net > > > "Ray Marron" <null(a)raymarron.com> wrote in message > news:OF3cRv5RKHA.4592(a)TK2MSFTNGP06.phx.gbl... > > Chaplain Doug wrote: > >> How can I go about establishing a DELETE trigger on the Constituents > >> table? > > > > Look up CREATE TRIGGER in Books Online. Come back for more specific help > > if you get stuck. > > > > -- > > Ray Marron > > >
From: TheSQLGuru on 8 Oct 2009 15:06 This looks like a pretty useful example: IF OBJECT_ID ('Purchasing.LowCredit','TR') IS NOT NULL DROP TRIGGER Purchasing.LowCredit; GO CREATE TRIGGER LowCredit ON Purchasing.PurchaseOrderHeader AFTER INSERT AS DECLARE @creditrating tinyint, @vendorid int SELECT @creditrating = v.CreditRating, @vendorid = p.VendorID FROM Purchasing.PurchaseOrderHeader AS p INNER JOIN inserted AS i ON p.PurchaseOrderID = i.PurchaseOrderID JOIN Purchasing.Vendor AS v on v.VendorID = i.VendorID IF @creditrating = 5 BEGIN RAISERROR ('This vendor''s credit rating is too low to accept new purchase orders.', 16, 1) ROLLBACK TRANSACTION END GO Found in 2005 BOL here: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/edeced03-decd-44c3-8c74-2c02f801d3e7.htm -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Chaplain Doug" <ChaplainDoug(a)discussions.microsoft.com> wrote in message news:300236FE-9CB4-4C4B-A6CD-6649C2BC8BC1(a)microsoft.com... > > I have looked at the BOL. It is long on excruciating cryptic detail and > short on down to earth examples. I cannot make heads nor tails of it. I > guess that is my problem? > -- > Dr. Doug Pruiett > Good News Jail & Prison Ministry > www.goodnewsjail.org > > > "TheSQLGuru" wrote: > >> Yepper - BOL is a WONDERFUL resource! >> >> -- >> Kevin G. Boles >> Indicium Resources, Inc. >> SQL Server MVP >> kgboles a earthlink dt net >> >> >> "Ray Marron" <null(a)raymarron.com> wrote in message >> news:OF3cRv5RKHA.4592(a)TK2MSFTNGP06.phx.gbl... >> > Chaplain Doug wrote: >> >> How can I go about establishing a DELETE trigger on the Constituents >> >> table? >> > >> > Look up CREATE TRIGGER in Books Online. Come back for more specific >> > help >> > if you get stuck. >> > >> > -- >> > Ray Marron >> >> >>
First
|
Prev
|
Pages: 1 2 Prev: Timeout after Mirroring Failover Next: Using SSMS2008 to view Job Activity Monitor on SQL2005 - cw |