dbTalk Databases Forums  

Re: Trigger query

microsoft.public.sqlserver.mseq microsoft.public.sqlserver.mseq


Discuss Re: Trigger query in the microsoft.public.sqlserver.mseq forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vishal Parkar
 
Posts: n/a

Default Re: Trigger query - 07-15-2003 , 12:36 PM






Change the where clause as:

Where exists( select 1 from inserted ins where ins.Grn = GRD.Grn
and ins.Journal = GRD.Journal
and ins.JournalEntry = GRD.JournalEntry
and ins.GrnSource = GRD.GrnSource) and Inv.TextType = 'P'

--
-Vishal
"Newbie" <noidea (AT) nospam (DOT) com> wrote

Quote:
Hi
I have an Insert trigger that returns data relating to the record that has
just be inserted. How can I amend this query to limit the
InvNarration.Text
that is selected to InvNarration.TextType = 'P'

Thanks for any help

A

FYI - here is the query

SELECT DISTINCT
GRD.Supplier, GRD.Grn, GRD.Journal, GRD.JournalEntry,
GRD.GrnSource, IST.Serial, GRD.PurchaseOrder, GRD.PurchaseOrderLin,
GRD.StockCode,
GRD.QtyReceived, GRD.QtyUom, GRD.DeliveryNote,
GRD.OrigReceiptDate, INM.Description, INM.LongDesc, INM.DrawOfficeNum,
APA.SupAddr1,
APA.SupAddr2, APA.SupAddr3, APM.SupplierClass,
APA.SupAddr5,
APA.SupAddr4, APA.SupPostalCode, IJD.Notation, IJD.RejectCode,
APM.SupplierName, dbo.InvNarration.Text
FROM dbo.GrnDetails GRD INNER JOIN
dbo.InvJournalDet IJD ON GRD.Journal = IJD.Journal AND
GRD.JournalEntry = IJD.EntryNumber AND GRD.GrnYear = IJD.JnlYear AND
GRD.GrnMonth = IJD.JnlMonth INNER JOIN
dbo.ApSupplier APM ON GRD.Supplier = APM.Supplier INNER
JOIN
dbo.ApSupplierAddr APA ON GRD.Supplier = APA.Supplier INNER
JOIN
dbo.InvMaster INM ON GRD.StockCode = INM.StockCode LEFT
OUTER
JOIN
dbo.InvNarration INV ON GRD.StockCode = INV.StockCode LEFT
OUTER JOIN
dbo.InvSerialTrn IST ON GRD.Grn = IST.Reference
Where exists( select 1 from inserted ins where ins.Grn = GRD.Grn
and ins.Journal = GRD.Journal
and ins.JournalEntry = GRD.JournalEntry
and ins.GrnSource = GRD.GrnSource) and





Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.