TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mike
NA
23
5.3k
Sql Trigger - multi-part identifier could not be bound
Jun 9 2016 1:12 AM
I'm trying to insert a QuoteNumber from a table called AccountInfo into a table call ShippingInfo where the columns ShippingIdentity match, but I keep getting this error when I try to run this code. The line that throws the error is:
inner join inserted on ShippingInfo.ShippingIdentity = a.ShippingIdentity.
Can someone please tell me why? Thanks for any help.
ALTER TRIGGER InsertQuoteNumber
ON AccountInfo
FOR INSERT
AS
BEGIN
INSERT INTO ShippingInfo (QuoteNumber)
SELECT a.QuoteNumber
FROM INSERTED as a
inner join inserted on ShippingInfo.ShippingIdentity = a.ShippingIdentity
update ShippingInfo set QuoteNumber = i.QuoteNumber
from ShippingInfo s
inner join inserted i on s.ShippingIdentity = i.ShippingIdentity
END
Reply
Answers (
4
)
SQL command to select list attended people particular month!
How to get data from two tables in sql