Viewing 15 posts - 361 through 375 (of 391 total)
The trigger is reliably setting [Transfered] = 'True' if the condition of the INSERTED Transaction type is 'Transfer', but I want it to update not the INSERTED record but a...
November 27, 2012 at 11:05 am
Thanks... your idea worked of thr UNION All and one trigger!.... my misstake was I has not deleted my original query which was still firing producing that dupe record.... many...
November 21, 2012 at 7:03 am
None of these have a possibility of being NULL: INSERTED.PO_Number + INSERTED.AppUser + INSERTED.SoftwareShortName + INSERTED.HeatTicketNumber,
None of the values are integers...
I'd have expected that a seperator would be used between...
November 20, 2012 at 2:33 pm
I had originally hoped to do just that with one trigger... but the trigger needs to create two records. I put the complete SQL below in and actually get THREE...
November 20, 2012 at 2:28 pm
Both the PO_Number and HeatTicketNumber are already Varchar as the table datatype... so (?) no need for conversion (?)...
I ran the code above and now have a SQL error popping...
November 12, 2012 at 3:02 pm
In general it seems to not like something else that keeps popping up:
Msg 102, Level 15, State 1, Procedure trPopulateJournalEntries, Line 11
Incorrect syntax near '('.
November 12, 2012 at 1:58 pm
A little outside my experience... I open cmd and see "Administrator: C:\WINDOWS\system32\cmd.exe" as the header of my command prompt... not sure what and where to type in my command...
October 29, 2012 at 10:30 am
OK Got it working... may not be pretty, but thoroughly tested and it is decrementing the Quantity_Remaing from tblBulkPurchases!
Thanks all, I learned a lot about virtual tables that I...
October 19, 2012 at 7:46 am
Did I get the data you needed or other information for the testing? Just can't seem to find what could be wrong with this trigger...
CREATE TRIGGER [dbo].[trDecrementBulkPurchases]
ON [dbo].[tblTransactions]
AFTER INSERT
AS
BEGIN
UPDATE tblBulkPurchases
SET...
October 19, 2012 at 7:07 am
It's a matter of timing - bulk purchases of software are handled in one transaction within the tblTransactions and may linger in inventory possibly for weeks before before each is...
October 18, 2012 at 12:03 pm
The trigger that is fired upon inserting data to tblTransactions will also populate the table tblBulkPurchases:
USE [TrackIT]
GO
CREATE TRIGGER [dbo].[trPopulateBulkPurchases]
ON [dbo].[tblTransactions]
AFTER INSERT
AS
BEGIN
INSERT INTO tblBulkPurchases
(tblBulkPurchases.PO_Number,
tblBulkPurchases.Buyer_Initial,
tblBulkPurchases.Quantity,
tblBulkPurchases.Transaction_Number,
tblBulkPurchases.Quantity_Remaining,
tblBulkPurchases.Unit_Price,
tblBulkPurchases.Software_Description,
...
October 18, 2012 at 10:59 am
Like this?:
INSERT INTO [TrackIT].[dbo].[tblTransactions]
([Buyer_Initial],[PO_Number],[Software_ID],[Transaction_Number],[Transaction_Type])
VALUES
('OCC','5465115','51',17999,'From Bulk Assignment')
GO
INSERT INTO [TrackIT].[dbo].[tblTransactions]
...
October 18, 2012 at 9:10 am
How should I paste the needed data? It becomes rather scrambled copying from SQL Server.
PO_NumberBuyer_InitialSoftware_IDQuantityQuantity_RemainingUnit_PriceSoftware_DescriptionAllocationAccountPurchaseAccountHeatTicketNumberPurchaseCostCenterPO_DateTransaction_DateTransaction_NumberTransaction_Type
3321809JDMNULL61956195NULLSYMANTEC ENDPOINT ENCRYPTION FULL DISKNULLNULL1581886NULL2011-10-132011-10-1322Bulk Purchase
5447441TRE405050315.22OfficePro1321353424244445242145154222012-05-122012-09-1517350Bulk Purchase
5465115OCC51200200120.20Apache3354825193219415995112542012012-05-122012-09-1517300Bulk Purchase
5965215OCC51100100120.20Apache3354825193219415995112452012012-05-122012-09-1517309Bulk Purchase
October 18, 2012 at 8:51 am
INSERT INTO [TrackIT].[dbo].[tblTransactions]
([PO_Number],[Buyer_Initial],[Quantity_Remaining],[Quantity],[Software_Description]
,[HeatTicketNumber],[PO_Date],[Transaction_Date],[Transaction_Number]
,[Transaction_Type])
VALUES
...
October 18, 2012 at 7:42 am
These are two separate triggers though.
trDecrementBulkPurchases is called from "WHERE Transaction_Type = 'From Bulk Assignment'"
trPopulateBulkPurchases is called from "WHERE Transaction_Type = 'Bulk Purchase'"
I ran this also and no effect:
USE...
October 18, 2012 at 5:15 am
Viewing 15 posts - 361 through 375 (of 391 total)