Viewing 15 posts - 1 through 15 (of 17 total)
dwain.c (2/17/2012)
John - You're way over my head with that.Maybe grasshopper wants both fields in the join because a PART_ID can have more than one CODE?
You're absolutely right!
February 17, 2012 at 6:10 pm
This one works:
ALTER TRIGGER [dbo].[ORDERS_tg]
ON [dbo].[ORDERS]
AFTER INSERT,UPDATE
AS
BEGIN
SET NOCOUNT ON;
IF UPDATE (PART_ID)
UPDATE o
SET CODE = m.CODE
,SIZE = m.SIZE
FROM ORDERS o
INNER JOIN Inserted i...
February 17, 2012 at 2:10 am
Hi John, sorry if I confused you.
My 1st post indicate the tables(MASTERS and ORDERS) and data of the database.
The MASTERS table already have some data just like this:
INSERT INTO MASTERS
VALUES...
February 17, 2012 at 1:58 am
Data on CODE and SIZE are just repeating.
February 17, 2012 at 1:16 am
saw that one. That's great.
one more thing, I need to make a inner join on MASTERS.PART_ID = ORDERS.PART_ID AND MASTERS.CODE = ORDERS.CODE
February 17, 2012 at 12:49 am
Doesn't seem to work, I'll try to modify it and see what happens.
Thanks
February 16, 2012 at 10:37 pm
Got it, forgot to put mt on the CASE statement.
Now its working fine and as expected. Thanks
ALTER TRIGGER [dbo].[linecbm] ON [dbo].[SALES_ORDER_LINE]
AFTER UPDATE
AS
IF UPDATE (DRAWING_REV_NO)
UPDATEmt
SETmt.HEIGHT =
CASE
WHEN mt.DRAWING_ID = 'set'...
February 10, 2012 at 7:50 pm
I see, CASE is a better option.
getting an error: Ambiguous column name 'DRAWING_ID'
February 10, 2012 at 7:35 pm
Guys, thanks for the help. I'ts working now.
I changed my code to this:
ALTER TRIGGER [dbo].[boxqty]
ON [dbo].[PACKAGING]
AFTER INSERT, UPDATE, DELETE
AS
WITH BX AS (
select PACK_ID from inserted
...
February 7, 2012 at 8:12 pm
I've tried this but cannot seem to make it work.
CREATE TRIGGER boxqty
ON PACKAGING
AFTER INSERT, UPDATE, DELETE
AS
WITH BX AS (PACKAGING
select PACK_ID from inserted
union
select...
February 7, 2012 at 7:57 pm
Possible Values:
1/1
1/2
1/3
1/4
1/5
1/6
1/8
2/1
3/1
4/1
5/1
6/1
7/1
8/1
I'm thinking about CASE statement for e lesser code. What do you think?
February 7, 2012 at 7:44 pm
mhike2hale, the code is working fine.
But, what if the data inputted on PACK_TYPE has been changed? Like 2/1 4/1...
The computed column will always detect 1
How can i make it recognize...
February 7, 2012 at 6:40 pm
I've tried it but i'm having difficulties building a formula.
Can you please show me how?
thanks
February 6, 2012 at 8:04 pm
Table Build:
CREATE TABLE PACKAGING
(RECORD_ID INT IDENTITY(1,1) PRIMARY KEY,
PACK_ID varchar(4),
BOX_QTY numeric(10,0)
Data:
use TEST01
insert into PACKAGING
values('1/1', NULL)
insert into PACKAGING
values('1/2', NULL)
insert into PACKAGING
values('1/3', NULL)
insert into PACKAGING
values('1/4', NULL)
insert into PACKAGING
values('1/5',...
February 3, 2012 at 8:56 pm
Viewing 15 posts - 1 through 15 (of 17 total)