Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
My trigger is not insert value into correct row
mike
Jun 9 2016 12:23 PM
309
Reply
hello,
I'm trying to write a trigger that get a QuoteNumber from table 1 and insert it into table 2 where ShippingIdentity matches the records in both tables. The problem is the QuoteNumber is being inserted into it's own row(record) Can anyone please let me know why? Thanks.
ALTER TRIGGER InsertQuoteNumber
ON AccountInfo
FOR INSERT
AS
BEGIN
INSERT INTO ShippingInfo (QuoteNumber)
SELECT a.QuoteNumber
FROM AccountInfo a
inner join inserted i on a.ShippingIdentity = i.ShippingIdentity
END
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to get data from two tables in sql
sql query for duplicate records