Click here to Skip to main content
15,890,399 members
Home / Discussions / Database
   

Database

 
GeneralRe: Help necessary in making Query Pin
Mycroft Holmes1-Jul-09 21:39
professionalMycroft Holmes1-Jul-09 21:39 
General[Message Deleted] Pin
Niladri_Biswas1-Jul-09 22:19
Niladri_Biswas1-Jul-09 22:19 
GeneralRe: Help necessary in making Query Pin
Mycroft Holmes1-Jul-09 22:48
professionalMycroft Holmes1-Jul-09 22:48 
AnswerRe: Help necessary in making Query Pin
Niladri_Biswas1-Jul-09 20:39
Niladri_Biswas1-Jul-09 20:39 
QuestionTrigger NOT Fireing... Pin
Elizma1-Jul-09 9:36
Elizma1-Jul-09 9:36 
AnswerRe: Trigger NOT Fireing... Pin
Blue_Boy1-Jul-09 11:22
Blue_Boy1-Jul-09 11:22 
AnswerRe: Trigger NOT Fireing... Pin
Jerry Hammond1-Jul-09 12:28
Jerry Hammond1-Jul-09 12:28 
GeneralRe: Trigger NOT Fireing... [modified] Pin
Elizma1-Jul-09 20:48
Elizma1-Jul-09 20:48 
Hi
Here is my code.

CREATE Trigger [trg_MovementsLog]
ON [dbo].[GtrDetail]
FOR INSERT
AS
INSERT INTO tblMovementsLog(GtrReference,Line,StockCode, QtyMoved, MovedBy,TransactionDate)
SELECT inserted.GtrReference,inserted.Line, inserted.StockCode, inserted.GtrQuantity AS QtyMoved,
SUBSTRING(LotTransactions.Narration,9,Len(LotTransactions.Narration)-8) AS MovedBy, inserted.TransactionDate
FROM inserted INNER JOIN
GtrLot ON inserted.GtrReference = GtrLot.GtrReference AND inserted.Line = GtrLot.Line INNER JOIN
LotTransactions ON GtrLot.Lot = LotTransactions.LotJob AND inserted.GtrReference = LotTransactions.Reference AND
inserted.StockCode = LotTransactions.StockCode
WHERE (inserted.TargetWarehouse = 'HS') AND (NOT (inserted.TransferComplete = 'Y')) AND (LotTransactions.Narration LIKE 'JOB_TRF_%')

I know however that my code does work. The trigger use to work fine until they re-installed the server. Also it runs if I manually insert a record into the GtrDetail table. It just does not run when it's basically inserted via a script (Well, so it seems).

Thanx for your assistance.

Elizma

modified on Thursday, July 2, 2009 2:55 AM

QuestionDecimal field format problem Pin
Branislav Vidovic1-Jul-09 3:25
Branislav Vidovic1-Jul-09 3:25 
AnswerRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 6:58
Enver Maroshi1-Jul-09 6:58 
GeneralRe: Decimal field format problem Pin
Branislav Vidovic1-Jul-09 12:19
Branislav Vidovic1-Jul-09 12:19 
GeneralRe: Decimal field format problem Pin
Enver Maroshi1-Jul-09 23:18
Enver Maroshi1-Jul-09 23:18 
GeneralRe: Decimal field format problem Pin
Blue_Boy2-Jul-09 3:03
Blue_Boy2-Jul-09 3:03 
QuestionMDB opened indication Pin
udikantz1-Jul-09 0:05
udikantz1-Jul-09 0:05 
AnswerRe: MDB opened indication Pin
paas1-Jul-09 1:46
paas1-Jul-09 1:46 
AnswerRe: MDB opened indication Pin
Branislav Vidovic1-Jul-09 3:54
Branislav Vidovic1-Jul-09 3:54 
GeneralRe: MDB opened indication Pin
udikantz1-Jul-09 4:45
udikantz1-Jul-09 4:45 
GeneralRe: MDB opened indication Pin
David Skelly1-Jul-09 6:17
David Skelly1-Jul-09 6:17 
GeneralRe: MDB opened indication Pin
riced2-Jul-09 7:09
riced2-Jul-09 7:09 
QuestionSplitting Rows in SQL Server 2005 Pin
rajanandal30-Jun-09 19:04
rajanandal30-Jun-09 19:04 
AnswerRe: Splitting Rows in SQL Server 2005 [modified] Pin
Niladri_Biswas30-Jun-09 20:02
Niladri_Biswas30-Jun-09 20:02 
GeneralRe: Splitting Rows in SQL Server 2005 Pin
rajanandal30-Jun-09 20:32
rajanandal30-Jun-09 20:32 
GeneralRe: Splitting Rows in SQL Server 2005 [modified] Pin
Niladri_Biswas30-Jun-09 20:45
Niladri_Biswas30-Jun-09 20:45 
AnswerRe: Splitting Rows in SQL Server 2005 [modified] Pin
rajanandal30-Jun-09 20:53
rajanandal30-Jun-09 20:53 
GeneralGreen Screen Studio Pin
atlas2130-Jun-09 17:07
atlas2130-Jun-09 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.